Regtest sendtoaddress Not Working (Reddit Bitcoin)

I am using regtest to test a payment verification script. So I generate an address then mine 101 blocks to it to give some bitcoin on my chain. I then use my app to generate new address and payment amount. Next I set up a script to verify payments in Core. So everything works except when I use sendtoaddress in anything including CLI to test walletnotify and blocknotify the transaction it gives a new transaction and I can use gettransaction to get details but "amount" always returns as 0 and it looks like its trying to spend and receive at the address I entered in sendtoaddress. Why is it doing this? I just want to be able to test my script to accept bitcoin. Here is an example transaction return for gettransaction:

{ "amount": 0.00000000, "fee": -0.00006640, "confirmations": 0, "trusted": true, "txid": "fdc1c7513a9a29e24985cb555a24584ff6a9f7be926bf0b543f58edb4c23d401", "walletconflicts": [ ], "time": 1567469341, "timereceived": 1567469341, "bip125-replaceable": "no", "details": [ { "address": "2MvLcPwX4UcqFNHFtKWHcuiF11Y2P6pPZe4", "category": "send", "amount": -0.10265454, "label": "", "vout": 0, "fee": -0.00006640, "abandoned": false }, { "address": "2MvLcPwX4UcqFNHFtKWHcuiF11Y2P6pPZe4", "category": "receive", "amount": 0.10265454, "label": "", "vout": 0 } ], "hex": "02000000000101b75e2d02dd1bd1892034ee778457bfdf53abdb81b6071cff03864b0c70fce7b2000000001716001438448296ceb61b64e808258245460af218bc9754feffffff026ea39c000000000017a91421ed298d61b101a1ceea2b99138d03ef7f1c0b5587a23469290100000017a914e63f39e6ad37edd971d0670b5d7bbc402cbe3608870247304402200ced6af2f54ce1afd4dd19cbb0ca551b1c72df774f76bbe0beeef02b262f5a2302206dc6d21e1da27d6041d0be28ab640ade4a34eb528aba0029116ecd189ae4030c012103dea292bb1e693482d4ae904a757481778c7c06119fbf18ecd4182e67567abbfb65000000" }

submitted by /u/jockyboy_sacks
[link] [comments]


Popular posts from this blog Just Rebranded – Check out Our New Look ( News)