Using bitcoin-cli decoderawtransaction, i got the txid of the only one vin, and the value of two vout are set at 0.015 BTC. Then, using bitcoin-cli gettransaction, i got negative value of amount and fee. How could the transaction have negative value of amount and fee ? Could this be the reason of that error "bad-txns-in-belowout"?
./bitcoin-cli -regtest decoderawtransaction "hexvalue" { "txid": "35d2e765217d71db34fd0cd1cf52f419fc525069ac87ed9f413b194851c70849", "hash": "35d2e765217d71db34fd0cd1cf52f419fc525069ac87ed9f413b194851c70849", "version": 1, "size": 338, "vsize": 338, "locktime": 0, "vin": [ { "txid": "2146415931a60db99ebf60849e2874dd67d37f870249a1ff06adcc6b8244155b", "vout": 0, ''' } "vout": [ { "value": 0.01500000, "n": 0, "scriptPubKey": { "asm": "OP_DUP OP_HASH160 dd100be7d9aea5721158ebde6d6a1fd8fff93bb1 OP_EQUALVERIFY OP_CHECKSIG", "hex": "76a914dd100be7d9aea5721158ebde6d6a1fd8fff93bb188ac", "reqSigs": 1, "type": "pubkeyhash", "addresses": [ "n1fprNxRhWrpkJ34A4cNsSZbHsnzhob2KL" ] } }, { "value": 0.01500000, "n": 1, ... } } ./bitcoin-cli -regtest gettransaction 2146415931a60db99ebf60849e2874dd67d37f870249a1ff06adcc6b8244155b { "amount": -0.08000000, "fee": -0.00100000, "confirmations": 0, "trusted": true, "txid": "2146415931a60db99ebf60849e2874dd67d37f870249a1ff06adcc6b8244155b", ... }