@@ -447,15 +447,22 @@ private bool ProcessBlock(Block block, ChainedHeader header)
447447 if ( amountSpent == 0 )
448448 continue ;
449449
450- string address = this . scriptAddressReader . GetAddressFromScriptPubKey ( this . network , new Script ( consumedOutputData . ScriptPubKeyBytes ) ) ;
450+ var address = this . scriptAddressReader . GetAddressFromScriptPubKey ( this . network , new Script ( consumedOutputData . ScriptPubKeyBytes ) ) ;
451451
452- if ( string . IsNullOrEmpty ( address ) )
452+ if ( address . IsNullOrEmpty ( ) )
453453 {
454454 // This condition need not be logged, as the address reader should be aware of all possible address formats already.
455455 continue ;
456456 }
457457
458- this . ProcessBalanceChangeLocked ( header . Height , address , amountSpent , false ) ;
458+ if ( address . Address != string . Empty )
459+ this . ProcessBalanceChangeLocked ( header . Height , address . Address , amountSpent , false ) ;
460+
461+ if ( address . HotAddress != string . Empty )
462+ this . ProcessBalanceChangeLocked ( header . Height , address . HotAddress , amountSpent , false ) ;
463+
464+ if ( address . ColdAddress != string . Empty )
465+ this . ProcessBalanceChangeLocked ( header . Height , address . ColdAddress , amountSpent , false ) ;
459466 }
460467
461468 // Process outputs.
@@ -469,16 +476,23 @@ private bool ProcessBlock(Block block, ChainedHeader header)
469476 if ( amountReceived == 0 || txOut . IsEmpty || txOut . ScriptPubKey . IsUnspendable )
470477 continue ;
471478
472- string address = this . scriptAddressReader . GetAddressFromScriptPubKey ( this . network , txOut . ScriptPubKey ) ;
479+ var address = this . scriptAddressReader . GetAddressFromScriptPubKey ( this . network , txOut . ScriptPubKey ) ;
473480
474- if ( string . IsNullOrEmpty ( address ) )
481+ if ( address . IsNullOrEmpty ( ) )
475482 {
476483 // This condition need not be logged, as the address reader should be aware of all
477484 // possible address formats already.
478485 continue ;
479486 }
480487
481- this . ProcessBalanceChangeLocked ( header . Height , address , amountReceived , true ) ;
488+ if ( address . Address != string . Empty )
489+ this . ProcessBalanceChangeLocked ( header . Height , address . Address , amountReceived , true ) ;
490+
491+ if ( address . HotAddress != string . Empty )
492+ this . ProcessBalanceChangeLocked ( header . Height , address . HotAddress , amountReceived , true ) ;
493+
494+ if ( address . ColdAddress != string . Empty )
495+ this . ProcessBalanceChangeLocked ( header . Height , address . ColdAddress , amountReceived , true ) ;
482496 }
483497 }
484498
0 commit comments