BitcoinINV (OP)
|
|
February 28, 2013, 03:21:19 PM |
|
I need someone to help me figure this out, my programmer had a family emergency and I have minimal skills. What is happening is when the script calls the addy if the balance is lower then the last call it will not add the coins untill it adds up past the fist amounts. Bulk wallet has address A address A is sent 5 coins 3 are withdraw from the the bulk wallet that pulls them from the address. In order for the address to show a new deposit it has to be higher then the last.
print("Checking member ["+str(member_id)+"] Bit Coin final amount for updates...") bitcoin_address = bitcoin_db_class.BitCoinDB.member_address_list[member_id]["address"] old_final_amount = bitcoin_db_class.BitCoinDB.member_address_list[member_id]["final_amount"] new_final_amount = Decimal(blockchain_api.BlockChainAPI.GetFinalAmount(bitcoin_address)) if new_final_amount <= old_final_amount: continue print("New amount["+str(new_final_amount)+"] found...Updating database...") bitcoin_db_class.BitCoinDB.AddMemberFinalAmount(member_id, new_final_amount) bitcoin_db_class.BitCoinDB.member_address_list[member_id]["final_amount"] = new_final_amount time_now = time.clock() run_once = True UpdateMembersBitCoinFinalAmountThread.going = False
Of course I am willing to pay for help!
|
|
|
|
|
|
"Bitcoin: mining our own business since 2009" -- Pieter Wuille
|
|
|
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
|
ironcross360
Full Member
Offline
Activity: 140
Merit: 100
Troll of the Fourth Reich.
|
|
February 28, 2013, 03:23:33 PM |
|
How much are you paying>
|
Why are you just staring at this? Just send it! 1MHZjADM41ttjbPUiTPYWGYGm45XLf8ZeS
|
|
|
greyhawk
|
|
February 28, 2013, 03:33:23 PM |
|
Here's your problem right there:
if new_final_amount <= old_final_amount: continue
If the current amount is less then the old amount, then the "continue" is executed ending the current loop.
Delete those two lines and you should be good.
|
|
|
|
BitcoinINV (OP)
|
|
February 28, 2013, 03:33:43 PM |
|
How much are you paying>
What background do you have? Can I see some examples of work you have completed or some references please.
|
|
|
|
BitcoinINV (OP)
|
|
February 28, 2013, 03:34:23 PM |
|
Here's your problem right there:
if new_final_amount <= old_final_amount: continue
If the current amount is less then the old amount, then the "continue" is executed ending the current loop.
Delete those two lines and you should be good.
Thank you greyhawk if it works Ill send a tip your way.
|
|
|
|
BitcoinINV (OP)
|
|
February 28, 2013, 05:15:19 PM Last edit: February 28, 2013, 05:32:34 PM by BitcoinINV |
|
seems to be a no go on that. Now it just reads and spits out the same amount each minute lol.
|
|
|
|
greyhawk
|
|
February 28, 2013, 05:43:23 PM |
|
Huh, interesting.
EDIT: Oh, waiiiit. Now I see what he's trying to do. This thing runs on a schedule, does it?
try reinserting the lines, but change them to this (getting rid of the lower than operator):
if new_final_amount = old_final_amount: continue
That basically says if there's no change in amounts, jump out of the loop, otherwise continue and update.
If that doesn't work I'm out of ideas.
|
|
|
|
adamstgBit
Legendary
Offline
Activity: 1904
Merit: 1037
Trusted Bitcoiner
|
|
February 28, 2013, 08:23:35 PM |
|
what lang is this? looks like VB
the <= appears to be what you want given the logic you described
what is the problem you are seeing with the current code, if you send more coin to the wallet Address A it doesn't update anything?
and what are you trying to do exactly? keep the balance up to date?
why wouldn't you simply always use the new_final_amount as the current balance?
|
|
|
|
BitcoinINV (OP)
|
|
February 28, 2013, 09:31:03 PM |
|
what lang is this? looks like VB
the <= appears to be what you want given the logic you described
what is the problem you are seeing with the current code, if you send more coin to the wallet Address A it doesn't update anything?
and what are you trying to do exactly? keep the balance up to date?
why wouldn't you simply always use the new_final_amount as the current balance?
It updates in my system fine, and thats all I want it to do. But what happens is if you deposit 5 bitcoins into one of the bulk wallet addresses then I withdraw it. The next deposit will not show up untill you deposit 5 bitcoins and thing it will only show the amount after that. I have to assume this would go on forever.
|
|
|
|
codro
Member
Offline
Activity: 91
Merit: 10
|
|
March 01, 2013, 02:25:16 PM |
|
Based on what you're describing, the problem is not in this piece of code.
When you're withdrawing, you should record the withdraw in the database somewhere by subtracting it from "final amount" stored in the database. So that the final amount/balance is always accurate to what is in the blockchain.
|
|
|
|
BitcoinINV (OP)
|
|
March 01, 2013, 03:40:13 PM |
|
Based on what you're describing, the problem is not in this piece of code.
When you're withdrawing, you should record the withdraw in the database somewhere by subtracting it from "final amount" stored in the database. So that the final amount/balance is always accurate to what is in the blockchain.
Ill see what I can do.
|
|
|
|
|