Hi everyone!
I made a thread over
here (click me) about getreceivedbyaddress.
In short, does getreceivedbyaddress only include confirmed transactions or also unconfirmed ones?
Looking through the source gives me the impression that it counts both confirmed and unconfirmed transactions:
def jsonrpc_getreceivedbyaddress(self, address):
"""
DESCRIPTION:
Get the number of coins received by a Base58 address associated with
the currently loaded wallet.
PARAMETERS:
address - The Base58 address associated with the current wallet.
RETURN:
The balance received from the incoming address (BTC).
"""
if CLI_OPTIONS.offline:
raise ValueError('Cannot get received amount when offline')
# Only gets correct amount for addresses in the wallet, otherwise 0
addr160 = addrStr_to_hash160(address, False)[1]
txs = self.curWlt.getAddrTxLedger(addr160)
balance = sum([x.getValue() for x in txs if x.getValue() > 0])
return AmountToJSON(balance)
Also looking through Transaction.py and PyBtcWallet.py did not give me any clues on how one would add an extra check to the lambda ( something like x.getConfirmations() > minconfs ) to only include confirmed transactions.
Any advice / inputs?