> $bitcoin_rpc.getnewaddress("myaddress", "bech32")
 => "bc1q9kvfyjxtk9tvkzgpkf4x8zs42sddwlyanz3z6z" 
> $bitcoin_rpc.getbalance
 => 0.0 
> $bitcoin_rpc.getbalance("*", 0)
 => 0.0 
> $bitcoin_rpc.listtransactions
 => [{"address"=>"bc1q9kvfyjxtk9tvkzgpkf4x8zs42sddwlyanz3z6z", "category"=>"receive", "amount"=>0.00025, "label"=>"myaddress", "vout"=>1, "confirmations"=>0, "trusted"=>false, "txid"=>"ad922349668c17c3ab47081f6dbc6e7e8f68473840146bfdd18f35f7d0bca216", "walletconflicts"=>[], "time"=>1574217056, "timereceived"=>1574217056, "bip125-replaceable"=>"yes"}] 
> Time.now.to_i
 => 1574217344 

What's the magic behind it? Since confirmation=0 is default, I would expect a return value of 0.00025.

  • I suspect it's because the fee paid by that transaction is so low. – David Schwartz Nov 20 '19 at 3:17

getbalance returns the balance that your node currently considers spendable. According to your console output, the transaction that sent you the output was flagged as "bip125-replaceable"=>"yes". Since a transaction flagged as replaceable can be amended or retracted by the sender until it gets confirmed, an output from such a transaction will not be considered reliable and not used as an input until confirmed.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.