Skip to content

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
akumaigorodski committed Dec 10, 2021
1 parent e44fa33 commit f287e45
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 16 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Simple Bitcoin Wallet (aka SBW) is an [IMMORTAN](https://github.com/btcontract/I
```
git clone https://github.com/btcontract/wallet.git
cd wallet
git checkout 2.4.22
git checkout 2.4.23
podman build -t sbw .
podman run -v $PWD:/app/simplebitcoinwallet/wallet:z sbw
```
Expand All @@ -49,15 +49,15 @@ podman run -v $PWD:/app/simplebitcoinwallet/wallet:z sbw
Install Android SDK, create a `keystore.jks` using `keytool`.

```
$ <Android SDK dir>/build-tools/<version>/zipalign -v 4 app/build/outputs/apk/release/SBW-2.4.22.apk app/build/outputs/apk/release/SBW-2.4.22-aligned.apk
$ <Android SDK dir>/build-tools/<version>/zipalign -v 4 app/build/outputs/apk/release/SBW-2.4.23.apk app/build/outputs/apk/release/SBW-2.4.23-aligned.apk
$ <Android SDK dir>/build-tools/<version>/apksigner sign --ks <path to keystore.jks> --ks-key-alias <signing key alias> --v1-signing-enabled true --v2-signing-enabled true app/build/outputs/apk/release/SBW-2.4.22-aligned.apk
$ <Android SDK dir>/build-tools/<version>/apksigner sign --ks <path to keystore.jks> --ks-key-alias <signing key alias> --v1-signing-enabled true --v2-signing-enabled true app/build/outputs/apk/release/SBW-2.4.23-aligned.apk
```

## Verification with `apksigner`

```
$ '<Android SDK dir>/build-tools/<version>/apksigner' verify --print-certs --verbose SBW-2.4.22.apk
$ '<Android SDK dir>/build-tools/<version>/apksigner' verify --print-certs --verbose SBW-2.4.23.apk
```

Output should contain the following info:
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ android {
targetSdkVersion 30
minSdkVersion 21

versionName '2.4.22'
versionCode 90
versionName '2.4.23'
versionCode 91

ndk {
abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/btcontract/wallet/HubActivity.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1155,8 +1155,8 @@ class HubActivity extends NfcReaderActivity with ChanErrorHandlerActivity with E

val sender = new CanBeRepliedTo {
override def process(reply: Any): Unit = reply match {
case PathFinder.NotifyNotReady => fillFlow(getString(dialog_up_to).format(ExpectedRouteFees(Router.defAvgHops) highCapRatio origAmount) + PERCENT).run
case exp: ExpectedRouteFees => fillFlow(getString(dialog_up_to).format(exp highCapRatio origAmount) + PERCENT).run
case PathFinder.NotifyNotReady => fillFlow(getString(dialog_up_to).format(ExpectedRouteFees(Router.defAvgHops) % origAmount) + PERCENT).run
case expectedRouteFees: ExpectedRouteFees => fillFlow(getString(dialog_up_to).format(expectedRouteFees % origAmount) + PERCENT).run
case _ => fillFlow("n/a").run
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/fr/acinq/eclair/router/Router.scala
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ object Router {
}

case class NodeHop(nodeId: PublicKey, nextNodeId: PublicKey, cltvExpiryDelta: CltvExpiryDelta, fee: MilliSatoshi) extends Hop {
override def toString: String = s"Trampoline, node: ${nodeId.value.toHex}, fee reserve: $fee"
override def toString: String = s"Trampoline, node: ${nodeId.value.toHex}, fee reserve: $fee, cltv reserve: ${cltvExpiryDelta.underlying}"
override def fee(amount: MilliSatoshi): MilliSatoshi = fee
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,10 @@ case class AvgHopParams(cltvExpiryDelta: CltvExpiryDelta, feeProportionalMillion
def relayFee(amount: MilliSatoshi): MilliSatoshi = nodeFee(feeBaseMsat, feeProportionalMillionths, amount)
}

case class NodeIdTrampolineParams(nodeId: PublicKey, trampolineOn: TrampolineOn) {
case class NodeIdTrampolineParams(nodeId: PublicKey, trampolineOn: TrampolineOn) extends HasRelayFee {
def relayFee(amount: MilliSatoshi): MilliSatoshi = trampolineOn.relayFee(amount)
def cltvExpiryDelta: CltvExpiryDelta = trampolineOn.cltvExpiryDelta

def withRefreshedParams(update: TrampolineStatusUpdate): NodeIdTrampolineParams = {
val trampolineOn1 = update.updatedParams.getOrElse(nodeId, trampolineOn)
copy(trampolineOn = trampolineOn1)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/immortan/ChannelMaster.scala
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ class ChannelMaster(val payBag: PaymentBag, val chanBag: ChannelBag, val dataBag
// Prepare sender FSM and fetch expected fees for payment
// these fees will be replied back to FSM for trampoline sends
opm process CreateSenderFSM(localPaymentListeners, cmd.fullTag)
pf process PathFinder.GetExpectedPaymentFees(opm, cmd, interHops = 2)
pf process PathFinder.GetExpectedPaymentFees(opm, cmd, interHops = 3)
}

// These are executed in Channel context
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/java/immortan/PathFinder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ object PathFinder {
case class GetExpectedRouteFees(sender: CanBeRepliedTo, payee: PublicKey, interHops: Int) extends PathFinderRequest

case class ExpectedRouteFees(hops: List[HasRelayFee] = Nil) {
def highCapRatio(amount: MilliSatoshi): Double = ratio(amount, totalWithFee(amount) - amount)
private def accumulate(accumulator: MilliSatoshi, hop: HasRelayFee) = accumulator + hop.relayFee(accumulator)
def totalWithFee(amount: MilliSatoshi): MilliSatoshi = hops.reverse.foldLeft(amount)(accumulate)
def % (amount: MilliSatoshi): Double = ratio(amount, totalWithFeeReserve(amount) - amount)
def totalCltvDelta: CltvExpiryDelta = hops.map(_.cltvExpiryDelta).reduce(_ + _)

private def accumulate(hasRelayFee: HasRelayFee, accumulator: MilliSatoshi): MilliSatoshi = hasRelayFee.relayFee(accumulator) + accumulator
def totalWithFeeReserve(amount: MilliSatoshi): MilliSatoshi = hops.foldRight(amount)(accumulate)
}
}

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/immortan/fsm/OutgoingPaymentMaster.scala
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@ class OutgoingPaymentSender(val fullTag: FullPaymentTag, val listeners: Iterable
data.parts.values.collectFirst {
case wait: WaitForRouteOrInFlight if wait.flight.isEmpty && wait.partId == found.partId =>
// TODO: even if route is found we can compare its fees against trampoline fees here and choose trampoline if its fees are more attractive
val chainExpiry = data.cmd.chainExpiry.fold(fb = _.toCltvExpiry(LNParams.blockCount.get + 1L), fa = identity)
val finalPayload = Onion.createMultiPartPayload(wait.amount, data.cmd.split.totalSum, chainExpiry, data.cmd.outerPaymentSecret, data.cmd.onionTlvs, data.cmd.userCustomTlvs)
val payeeExpiry = data.cmd.chainExpiry.fold(fb = _.toCltvExpiry(LNParams.blockCount.get + 1L), fa = identity)
val finalPayload = Onion.createMultiPartPayload(wait.amount, data.cmd.split.totalSum, payeeExpiry, data.cmd.outerPaymentSecret, data.cmd.onionTlvs, data.cmd.userCustomTlvs)
val (firstAmount, firstExpiry, onion) = OutgoingPacket.buildPacket(Sphinx.PaymentPacket)(wait.onionKey, fullTag.paymentHash, found.route.hops, finalPayload)
val cmdAdd = CMD_ADD_HTLC(fullTag, firstAmount, firstExpiry, PacketAndSecrets(onion.packet, onion.sharedSecrets), finalPayload)
become(data.copy(parts = data.parts + wait.copy(flight = InFlightInfo(cmdAdd, found.route).asSome).tuple), PENDING)
Expand Down
3 changes: 3 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/91.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* Use built-in Tor.
* Improve biometric auth.
* Minor UI improvements.

0 comments on commit f287e45

Please sign in to comment.