Author

Topic: Deamon sent part of balance to a new generates address (Read 630 times)

legendary
Activity: 3472
Merit: 4801
Accounts and addresses in the bitcoin daemon (and Bitcoin Core) don't work the way you've assumed that they do.

Addresses aren't accounts.  Outputs don't belong to accounts.

You can attach an address to an account if you want the account to be updated whenever bitcoins are SENT TO that address. However, bitcoin doesn't include a concept of sending FROM an address. The transaction output that was received at that address is not locked to the account, it gets mixed in with all the other outputs in the wallet.  It's just like going to a bank and making a deposit with cash.  When you give them your account number and deposit the cash,  the amount that you deposit is added to your account balance, but that physical currency gets mixed in with all the rest of the currency in the bank.

Later, when you return to the bank and take some physical currency back out, you'll get the same amount of currency, but not the exact same pieces of paper that you deposited.  Then your account balance will be updated to indicate that you have access to less money.  The account you are trying to use is the same. When you create a transaction (with the user interface, or with sendfrom, or with sendtoaddress, or anything other than createrawtransaction) to use some of the bitcoins, the account will be updated with the new balace, but the outputs that are spent won't necessarily be the same ones that that were received when the amount was added to the balance in the first place.

legendary
Activity: 1025
Merit: 1001
Thank you for your reply, i believe the only answer is indeed to create a rawtransaction.
legendary
Activity: 1456
Merit: 1081
I may write code in exchange for bitcoins.
Its change. The input[1] you are using is 0.089 bitcoin worth. You have to use all of those 0.089 bitcoin if you create a transaction. The client handles this for you, because the alternative is that you send 0.01 and pay the rest as fee.


[1] https://blockchain.info/tx/5db0cf9b34bae795941848c151d08b1103e30b2f2e4e3525144617e3862072be?show_adv=true

I understand so with sendfrom it will always take the whole balance out of the account, generates a new address puts the change on that address. Is there any way to keep the change on the account your sending from?

// Edit Got the solution
1) Generate new address
2) Give address from 1) an account name (like ordernumber)
3) Move amount needed from main wallet to the account made in 2)
4) sendfrom account 2 the amount, after that the address you created will be empty

// Edit 2 : Solution does not work. It does check the balance of account 2 and takes the amount in it (so it is empty after transaction), but it keeps sending from an address in an other account and generating a new address where it puts the rest on.


I may be wrong, but I believe that if you use createrawtransaction and sendrawtransaction then you can specify the change address as one of the outputs and if you just use your original address as that change address then you'll avoid the client creating new change addresses for you.
legendary
Activity: 1025
Merit: 1001
Its change. The input[1] you are using is 0.089 bitcoin worth. You have to use all of those 0.089 bitcoin if you create a transaction. The client handles this for you, because the alternative is that you send 0.01 and pay the rest as fee.


[1] https://blockchain.info/tx/5db0cf9b34bae795941848c151d08b1103e30b2f2e4e3525144617e3862072be?show_adv=true

I understand so with sendfrom it will always take the whole balance out of the account, generates a new address puts the change on that address. Is there any way to keep the change on the account your sending from?

// Edit Got the solution
1) Generate new address
2) Give address from 1) an account name (like ordernumber)
3) Move amount needed from main wallet to the account made in 2)
4) sendfrom account 2 the amount, after that the address you created will be empty

// Edit 2 : Solution does not work. It does check the balance of account 2 and takes the amount in it (so it is empty after transaction), but it keeps sending from an address in an other account and generating a new address where it puts the rest on.
copper member
Activity: 1498
Merit: 1528
No I dont escrow anymore.
Its change. The input[1] you are using is 0.089 bitcoin worth. You have to use all of those 0.089 bitcoin if you create a transaction. The client handles this for you, because the alternative is that you send 0.01 and pay the rest as fee.


[1] https://blockchain.info/tx/5db0cf9b34bae795941848c151d08b1103e30b2f2e4e3525144617e3862072be?show_adv=true
legendary
Activity: 1025
Merit: 1001
Hello,

I have a weird issue with my bitcoin deamon..

When i want to sent bitcoin to a outside deamon wallet address it sends the amount of bitcoin to the address i want but it takes a part of the balance to a new generates address

It doesnt mather if i use sendfrom of sendtoaddress.

Example 'https://blockchain.info/tx/5db0cf9b34bae795941848c151d08b1103e30b2f2e4e3525144617e3862072be'

The 0.01 BTC = the amount needed to be sent to the outside deamon wallet address
The 0.078 BTC = the amount the deamon sents to a new generated address within the deamon wallet.

What i want is this, i got a main account with one address for example '1KPiumRccmRzHyypjJ3mASZfnVXJiqfFXa' this account is called 'Demo'.
I want to sent 0.01 BTC to an address for example '1HRzoMXwHmmU7WQ3RjhU7kk51CWFQDZaep'

I want to sent 0.01 BTC to an outside deamon address with the following;
Code:
$bitcoin->sendfrom('Demo','1HRzoMXwHmmU7WQ3RjhU7kk51CWFQDZaep','0.01',3);

But everytime i do it doesnt mather if i do it per script or in de ssh using bitcoin-cli it does the problem shown above..



English is not my main language so the spelling might be wrong..
Jump to: