So I'm running the btcd node and wallet in simnet. I've generated more than 100 blocks. I've a few accounts on the same wallet. The list of the accounts:
$ btcctl --rpcuser=foo --rpcpass=123456 --simnet --wallet listaccounts
{
"account1": 13.7,
"account2": 0,
"default": 5601,
"imported": 0
}
The default
receives the reward for the generated block. Obviously I've moved some bitcoins already from the default
to account1
. Now I want to move 1 bitcoin from default
to account2
$ btcctl --rpcuser=foo --rpcpass=123456 --wallet --simnet sendtoaddress "SSBjQ58PsRmBtGZQ8ckXFRxijZFCBdeMMT" 1
e1a0b9c3df3297b4f50b210da3e63fda701dea4eb8638248e877b1308fdd3a61
I mine the block:
$ btcctl --simnet --wallet --rpcuser=foo --rpcpass=123456 generate 1
[
"6cd2423869ee9b865df759e6c60978b3899bfcf3d4f7174a4287971822bef5e5"
]
When I check the accounts I see this:
$ btcctl --rpcuser=foo --rpcpass=123456 --simnet --wallet listaccounts
{
"account1": 13.7,
"account2": 1,
"default": 5601,
"imported": 0
}
Inspecting the transaction:
$ btcctl --simnet --wallet --rpcuser=foo --rpcpass=123456 gettransaction e1a0b9c3df3297b4f50b210da3e63fda701dea4eb8638248e877b1308fdd3a61
{
"amount": 1,
"fee": 0.00000224,
"confirmations": 402,
"blockhash": "6cd2423869ee9b865df759e6c60978b3899bfcf3d4f7174a4287971822bef5e5",
"blockindex": 0,
"blocktime": 1591446501,
"txid": "e1a0b9c3df3297b4f50b210da3e63fda701dea4eb8638248e877b1308fdd3a61",
"walletconflicts": [],
"time": 1591446501,
"timereceived": 1591446501,
"details": [
{
"account": "",
"amount": -50,
"category": "send",
"fee": 0.00000224,
"vout": 0
},
{
"account": "account2",
"address": "SSBjQ58PsRmBtGZQ8ckXFRxijZFCBdeMMT",
"amount": 1,
"category": "receive",
"vout": 0
}
],
"hex": "0100000001129d6eb50f40f48e869413dbade07f055204b221322788ef90c1ca187e8cd09f000000006a473044022028a04f05d8a381210b7e89493d1946d25f8c211d3973a1164d3a0a5f4fee958202206709c6171fba242060fc9dbf1a4bb3ad14b18a45741282f1d55ed764bffed8480121035354d2edb51d3f05f8c0e31f7ab5ba7f97ff179b5e09005ec018c445c0d761d3ffffffff0200e1f505000000001976a91435a915238472497b40660cf625dee8c7ce3f3ae388ac2010102401000000160014708d04eb727ec0a8fdb7b362233ff8684056d21800000000"
}
After that I've generated many other blocks. My question is: why the transaction contains a "send" category of 50 bitcoins and another category "receive" for 1 bitcoin? Shouldn't be only 1 entry for 1 bitcoin? Why does the balance of the default
account is still the same? It should be with 49 more since I've mined the block, got the reward and sent 1.