parameters: (self, inB58)
return_statement: return utxoDict
docstring: DESCRIPTION:
        Get a list of unspent transactions for the currently loaded wallet that
        are associated with a given, comma-separated list of Base58 addresses from
        the wallet. By default, zero-conf UTXOs are included.
        PARAMETERS:
        inB58 - The Base58 address to check against the current wallet.
        RETURN:
        A dictionary containing all UTXOs for the currently loaded wallet
        associated with the given Base58 address, along with information about
        each UTXO.
docstring_summary: DESCRIPTION:
        Get a list of unspent transactions for the currently loaded wallet that
        are associated with a given, comma-separated list of Base58 addresses from
        the wallet. By default, zero-conf UTXOs are included.
        PARAMETERS:
        inB58 - The Base58 address to check against the current wallet.
        RETURN:
        A dictionary containing all UTXOs for the currently loaded wallet
        associated with the given Base58 address, along with information about
        each UTXO.
docstring_tokens: DESCRIPTION : Get a list of unspent transactions for the currently loaded wallet that are associated with a given comma - separated list of Base58 addresses from the wallet . By default zero - conf UTXOs are included . PARAMETERS : inB58 - The Base58 address to check against the current wallet . RETURN : A dictionary containing all UTXOs for the currently loaded wallet associated with the given Base58 address along with information about each UTXO .
function: def jsonrpc_listaddrunspent(self, inB58):
        """
        DESCRIPTION:
        Get a list of unspent transactions for the currently loaded wallet that
        are associated with a given, comma-separated list of Base58 addresses from
        the wallet. By default, zero-conf UTXOs are included.
        PARAMETERS:
        inB58 - The Base58 address to check against the current wallet.
        RETURN:
        A dictionary containing all UTXOs for the currently loaded wallet
        associated with the given Base58 address, along with information about
        each UTXO.
        """
        # TODO:  We should probably add paging to this...
  
        totalTxOuts = 0
        totalBal = 0
        utxoDict = {}
        utxoList = []
  
        # Get the UTXO balance & list for each address.
        # The strip() makes it possible to supply addresses with
        # spaces after or before each comma
        addrList = [a.strip() for a in inB58.split(",")]
        curTxOut = 0
        topBlk = TheBDM.getTopBlockHeight()
        addrBalanceMap = {}
        utxoEntries = []
        for addrStr in addrList:
           atype,a160 = addrStr_to_hash160(addrStr)
           if atype==ADDRBYTE:
              # Already checked it's registered, regardless if in a loaded wallet
              utxoList = getUnspentTxOutsForAddr160List([a160])
           elif atype==P2SHBYTE:
              # For P2SH, we'll require we have a loaded lockbox
              lbox = self.getLockboxByP2SHAddrStr(addrStr)
              if not lbox:
                 raise BitcoindError('Import lockbox before getting P2SH unspent')
  
              # We simply grab the UTXO list for the lbox, both p2sh and multisig
              cppWallet = self.serverLBCppWalletMap[lbox.uniqueIDB58]
              utxoList = cppWallet.getFullUTXOList()
           else:
              raise NetworkIDError('Addr for the wrong network!')
  
           # Place each UTXO in the return dict. Each entry should specify which
           # address is associated with which UTXO.
           # (DR: For 0.93, this ought to be merged with the listunspent code, and
           # maybe moved around a bit to make the info easier to process.)
           utxoListBal = 0
           for u in utxoList:
              curTxOut += 1
              curUTXODict = {}
  
              # Get the UTXO info.
              curTxOutStr = 'utxo%05d' % curTxOut
              utxoVal = AmountToJSON(u.getValue())
              curUTXODict['txid'] = binary_to_hex(u.getOutPoint().getTxHash(), \
                                                  BIGENDIAN, LITTLEENDIAN)
              curUTXODict['vout'] = u.getTxOutIndex()
              try:
                 curUTXODict['address']  = script_to_addrStr(u.getScript())
              except:
                 LOGEXCEPT('Error parse UTXO script -- multisig or non-standard')
                 curUTXODict['address']  = ''
              curUTXODict['scriptPubKey'] = binary_to_hex(u.getScript())
              curUTXODict['amount'] = utxoVal
              curUTXODict['confirmations'] = u.getNumConfirm(TheBDM.getTopBlockHeight())
              curUTXODict['priority'] = utxoVal * u.getNumConfirm(TheBDM.getTopBlockHeight())
  
              utxoEntries.append(curUTXODict)
              totalTxOuts += 1
              utxoListBal += u.getValue()
              totalBal    += u.getValue()
  
           # Add up the UTXO balances for each address and add it to the UTXO
           # entry dict, then add the UTXO entry dict to the master dict.
           addrBalanceMap[addrStr] = AmountToJSON(utxoListBal)
  
        # Let's round out the master dict with more info.
        utxoDict['utxolist']     = utxoEntries
        utxoDict['numutxo']      = totalTxOuts
        utxoDict['addrbalance']  = addrBalanceMap
        utxoDict['totalbalance'] = AmountToJSON(totalBal)
  
        return utxoDict
function_tokens: def jsonrpc_listaddrunspent ( self , inB58 ) : # TODO:  We should probably add paging to this... totalTxOuts = 0 totalBal = 0 utxoDict = { } utxoList = [ ] # Get the UTXO balance & list for each address. # The strip() makes it possible to supply addresses with # spaces after or before each comma addrList = [ a . strip ( ) for a in inB58 . split ( "," ) ] curTxOut = 0 topBlk = TheBDM . getTopBlockHeight ( ) addrBalanceMap = { } utxoEntries = [ ] for addrStr in addrList : atype , a160 = addrStr_to_hash160 ( addrStr ) if atype == ADDRBYTE : # Already checked it's registered, regardless if in a loaded wallet utxoList = getUnspentTxOutsForAddr160List ( [ a160 ] ) elif atype == P2SHBYTE : # For P2SH, we'll require we have a loaded lockbox lbox = self . getLockboxByP2SHAddrStr ( addrStr ) if not lbox : raise BitcoindError ( 'Import lockbox before getting P2SH unspent' ) # We simply grab the UTXO list for the lbox, both p2sh and multisig cppWallet = self . serverLBCppWalletMap [ lbox . uniqueIDB58 ] utxoList = cppWallet . getFullUTXOList ( ) else : raise NetworkIDError ( 'Addr for the wrong network!' ) # Place each UTXO in the return dict. Each entry should specify which # address is associated with which UTXO. # (DR: For 0.93, this ought to be merged with the listunspent code, and # maybe moved around a bit to make the info easier to process.) utxoListBal = 0 for u in utxoList : curTxOut += 1 curUTXODict = { } # Get the UTXO info. curTxOutStr = 'utxo%05d' % curTxOut utxoVal = AmountToJSON ( u . getValue ( ) ) curUTXODict [ 'txid' ] = binary_to_hex ( u . getOutPoint ( ) . getTxHash ( ) , BIGENDIAN , LITTLEENDIAN ) curUTXODict [ 'vout' ] = u . getTxOutIndex ( ) try : curUTXODict [ 'address' ] = script_to_addrStr ( u . getScript ( ) ) except : LOGEXCEPT ( 'Error parse UTXO script -- multisig or non-standard' ) curUTXODict [ 'address' ] = '' curUTXODict [ 'scriptPubKey' ] = binary_to_hex ( u . getScript ( ) ) curUTXODict [ 'amount' ] = utxoVal curUTXODict [ 'confirmations' ] = u . getNumConfirm ( TheBDM . getTopBlockHeight ( ) ) curUTXODict [ 'priority' ] = utxoVal * u . getNumConfirm ( TheBDM . getTopBlockHeight ( ) ) utxoEntries . append ( curUTXODict ) totalTxOuts += 1 utxoListBal += u . getValue ( ) totalBal += u . getValue ( ) # Add up the UTXO balances for each address and add it to the UTXO # entry dict, then add the UTXO entry dict to the master dict. addrBalanceMap [ addrStr ] = AmountToJSON ( utxoListBal ) # Let's round out the master dict with more info. utxoDict [ 'utxolist' ] = utxoEntries utxoDict [ 'numutxo' ] = totalTxOuts utxoDict [ 'addrbalance' ] = addrBalanceMap utxoDict [ 'totalbalance' ] = AmountToJSON ( totalBal ) return utxoDict