Bitcoin Forum
December 04, 2016, 08:18:38 AM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: « 1 2 [3]  All
  Print  
Author Topic: Reading the block chain with a library?  (Read 8837 times)
runeks
Legendary
*
Offline Offline

Activity: 924



View Profile WWW
October 07, 2012, 08:55:12 PM
 #41

Never mind. I was structuring my code wrong so the previous cppWallet wasn't deleted from memory before starting with the next (I think that's what was wrong). This works:

Code:
from armoryengine import *


BDM_LoadBlockchainFile()
   
def get_balance(addresses):
   cppWallet = Cpp.BtcWallet()

   for address in addresses:
      cppWallet.addAddress_1_( address )

   TheBDM.registerWallet(cppWallet)
   TheBDM.scanBlockchainForTx(cppWallet)
   fullBalance = cppWallet.getFullBalance()
   balance = coin2str(fullBalance)
   TheBDM.unregisterWallet(cppWallet)

   return balance
Pages: « 1 2 [3]  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!