@@ -818,18 +818,10 @@ static RPCHelpMan getaddressdeltas()
818818 {
819819 LOCK (::cs_main);
820820 for (const auto & address : addresses) {
821- if (start > 0 && end > 0 ) {
822- if (!GetAddressIndex (*chainman.m_blockman .m_block_tree_db , address.first , address.second ,
823- addressIndex, start, end))
824- {
825- throw JSONRPCError (RPC_INVALID_ADDRESS_OR_KEY, " No information available for address" );
826- }
827- } else {
828- if (!GetAddressIndex (*chainman.m_blockman .m_block_tree_db , address.first , address.second ,
829- addressIndex))
830- {
831- throw JSONRPCError (RPC_INVALID_ADDRESS_OR_KEY, " No information available for address" );
832- }
821+ if (start <= 0 || end <= 0 ) { start = 0 ; end = 0 ; }
822+ if (!GetAddressIndex (*chainman.m_blockman .m_block_tree_db , address.first , address.second ,
823+ addressIndex, start, end)) {
824+ throw JSONRPCError (RPC_INVALID_ADDRESS_OR_KEY, " No information available for address" );
833825 }
834826 }
835827 }
@@ -896,7 +888,8 @@ static RPCHelpMan getaddressbalance()
896888 {
897889 LOCK (::cs_main);
898890 for (const auto & address : addresses) {
899- if (!GetAddressIndex (*chainman.m_blockman .m_block_tree_db , address.first , address.second , addressIndex)) {
891+ if (!GetAddressIndex (*chainman.m_blockman .m_block_tree_db , address.first , address.second , addressIndex,
892+ /* start=*/ 0 , /* end=*/ 0 )) {
900893 throw JSONRPCError (RPC_INVALID_ADDRESS_OR_KEY, " No information available for address" );
901894 }
902895 }
@@ -977,16 +970,10 @@ static RPCHelpMan getaddresstxids()
977970 {
978971 LOCK (::cs_main);
979972 for (const auto & address : addresses) {
980- if (start > 0 && end > 0 ) {
981- if (!GetAddressIndex (*chainman.m_blockman .m_block_tree_db , address.first , address.second ,
982- addressIndex, start, end)) {
983- throw JSONRPCError (RPC_INVALID_ADDRESS_OR_KEY, " No information available for address" );
984- }
985- } else {
986- if (!GetAddressIndex (*chainman.m_blockman .m_block_tree_db , address.first , address.second ,
987- addressIndex)) {
988- throw JSONRPCError (RPC_INVALID_ADDRESS_OR_KEY, " No information available for address" );
989- }
973+ if (start <= 0 || end <= 0 ) { start = 0 ; end = 0 ; }
974+ if (!GetAddressIndex (*chainman.m_blockman .m_block_tree_db , address.first , address.second ,
975+ addressIndex, start, end)) {
976+ throw JSONRPCError (RPC_INVALID_ADDRESS_OR_KEY, " No information available for address" );
990977 }
991978 }
992979 }
0 commit comments