Skip to content

Commit

Permalink
Properly calculating input raw amount.
Browse files Browse the repository at this point in the history
  • Loading branch information
pokkst committed Aug 18, 2020
1 parent 9de2b8b commit 82e755a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/src/main/java/org/bitcoinj/core/slp/SlpTxBuilder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ class SlpTxBuilder {
.takeWhile {
val amountTooLow = inputTokensRaw < sendTokensRaw
if (amountTooLow) {
inputTokensRaw += toRawAmount(it.tokenAmountRaw.toBigDecimal(), tokenDetails)
inputTokensRaw += it.tokenAmountRaw.toULong()
inputSatoshi += (it.txUtxo.value.value - 148) // Deduct input fee
}
amountTooLow
Expand Down Expand Up @@ -312,7 +312,7 @@ class SlpTxBuilder {
.takeWhile {
val amountTooLow = inputTokensRaw < sendTokensRaw
if (amountTooLow) {
inputTokensRaw += toRawAmount(it.tokenAmountRaw.toBigDecimal(), tokenDetails)
inputTokensRaw += it.tokenAmountRaw.toULong()
inputSatoshi += (it.txUtxo.value.value - 148) // Deduct input fee
}
amountTooLow
Expand Down Expand Up @@ -380,7 +380,7 @@ class SlpTxBuilder {
.takeWhile {
val amountTooLow = inputTokensRaw < sendTokensRaw
if (amountTooLow) {
inputTokensRaw += toRawAmount(it.tokenAmountRaw.toBigDecimal(), tokenDetails)
inputTokensRaw += it.tokenAmountRaw.toULong()
inputSatoshi += (it.txUtxo.value.value - 148) // Deduct input fee
}
amountTooLow
Expand Down Expand Up @@ -448,7 +448,7 @@ class SlpTxBuilder {
.takeWhile {
val amountTooLow = inputTokensRaw < sendTokensRaw
if (amountTooLow) {
inputTokensRaw += toRawAmount(it.tokenAmountRaw.toBigDecimal(), tokenDetails)
inputTokensRaw += it.tokenAmountRaw.toULong()
inputSatoshi += (it.txUtxo.value.value - 148) // Deduct input fee
}
amountTooLow
Expand Down

0 comments on commit 82e755a

Please sign in to comment.