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)
{
}
But canCan someone read and explain the code? I see that receive
transactions have zero fees but what is listSent.empty()
, and other variables?Bitcoin core considers transactions with fees as sent.