I was wrong about this. Even though transactions to yourself are displayed differently, it appears like a normal transaction in the block.
"out" : [
{
"value" : "0.24000000",
"scriptPubKey" : "OP_DUP OP_HASH160 0x4434DD10F5392C1F080B83
92D3135D0D13670400 OP_EQUALVERIFY OP_CHECKSIG"
},
{
"value" : "51.13000000",
"scriptPubKey" : "OP_DUP OP_HASH160 0x98352ACB25A13F646AB75D
825B1B8911341BAE14 OP_EQUALVERIFY OP_CHECKSIG"
}
]
To determine that the payment is from yourself, Bitcoin just checks to see if all of the receiving addresses and all of sending addresses are in your wallet.
if (fAllFromMe && fAllToMe)
{
// Payment to self
int64 nValue = wtx.vout[0].nValue;
InsertLine(fNew, nIndex, hash, strSort,
strStatus,
nTime ? DateTimeStr(nTime) : "",
_("Payment to yourself"),
"",
"");
/// issue: can't tell which is the payment and which is the change anymore
// FormatMoney(nNet - nValue, true),
// FormatMoney(nValue, true));
}