From 35940e7847549fb6dff08b3a40cb807b7f90ca47 Mon Sep 17 00:00:00 2001 From: mrz1836 Date: Thu, 24 Dec 2020 13:24:47 -0500 Subject: [PATCH] Added to error response for now --- transaction.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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, ) }