0
1
How does Bitcoin core differentiate transactions category?
for instance, when we are calling listtrnasctions in the response body we have category, how bitcoin core assigns category type for a transaction?
Programmatically, How it decides that some transaction should have send or receive string.
The answer is in here:
// Sent
if ((!listSent.empty() || nFee != 0) && (fAllAccounts || strAccount == strSentAccount))
{
}
// Received
if (listReceived.size() > 0 && wtx.GetDepthInMainChain() >= nMinDepth)
{
}
Can someone read and explain the code? I see that receive transactions have zero fees, and Bitcoin core considers transactions with fees as sent.
What about HD wallet, when for example importing your mnemonic phrase on blockchain.info they differentiate
sentandreceivetransaction! how is that? – Adam – 2018-04-04T14:37:00.403Bitcoin core also utilizes HD wallets, the type of wallet doesn't change anything. A send/receive tx is differentiated the same way in every wallet, which is by utxos being spent/created. – Raghav Sood – 2018-04-04T14:39:54.787