Bitcoin Forum
May 31, 2024, 03:10:05 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 [3]  All
  Print  
Author Topic: Reading the block chain with a library?  (Read 9676 times)
runeks
Legendary
*
Offline Offline

Activity: 980
Merit: 1008



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:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!