diff --git a/transaction.go b/transaction.go index 56bd73a..3da8962 100644 --- a/transaction.go +++ b/transaction.go @@ -3,7 +3,6 @@ package bitcoin import ( "errors" "fmt" - "log" "strings" "github.com/bitcoinsv/bsvd/bsvec" @@ -112,8 +111,6 @@ func CreateTxWithChange(utxos []*Utxo, payToAddresses []*PayToAddress, opReturns // Get the remainder missing remainder := (totalPayToSatoshis + fee) - totalSatoshis - log.Println(fee, totalPayToSatoshis, remainder, totalSatoshis) - // Remove remainder from last used payToAddress (or continue until found) feeAdjusted := false for i := len(payToAddresses) - 1; i >= 0; i-- { // Working backwards @@ -127,8 +124,8 @@ func CreateTxWithChange(utxos []*Utxo, payToAddresses []*PayToAddress, opReturns // Fee was not adjusted (all inputs do not cover the fee) if !feeAdjusted { return nil, fmt.Errorf( - "auto-fee could not be applied without removing an output (outputs %d) (sats %d)", - len(payToAddresses), remainder, + "auto-fee could not be applied without removing an output (payTo %d) (amount %d) (remainder %d) (fee %d) (total %d)", + len(payToAddresses), totalPayToSatoshis, remainder, fee, totalSatoshis, ) }