Tx Sending Out All Funds At Once

Discussion in 'Transactions' started by ocminer, Apr 3, 2016.

  1. 2017/12/15 - Decred v1.1.2 released! → Release Notes  → Downloads
  1. ocminer

    ocminer Jr. Member
    Pool Operator (PoW)

    Jan 17, 2016
    135
    45
    Male
    I've got a weird issue since the last "consolidate": My wallet now sends out ALL the funds even when I only send 0.X DCR and returns the rest to the wallet... So I have for example 500 DCR balance, send out 0.5 DCR to a address, the wallet sends out 500 DCR, 0.5 DCR to the address where it belongs and 499.5 to a new address of my wallet. The problem is - until this TX is confirmed, my balance remains 0 letting all other TX'es fail...
     
  2. ceejep

    ceejep Sr. Member
    Developer

    Dec 14, 2015
    192
    220
    This sounds correct. The consolidate transferred all your funds into one output. If you want to spend change from a 0-conf transaction, you need to use sendfrom or sendmany and set minconf to 0 instead of using sendtoaddress. Send to address requires a minconf of 1.
     
  3. ocminer

    ocminer Jr. Member
    Pool Operator (PoW)

    Jan 17, 2016
    135
    45
    Male
    Usually it was that after a few confirmations I had the full balance back in my account. Then I could simply send multiple TX'es from that "big" balance, not only ONE transaction and I'd have to wait again for a few confirmations until the big balance is back ..

    Currently it's like this:

    Balance 2000
    Consolidate -> Balance 0
    After a few confs -> Balance 2000
    sendtoaddress dcdcdcdcdcd 0.5
    Balance 0
    After a few confs -> Balance 1999.5
    Sendtoaddress dededede 0.7
    Balance 0
    After a few confs -> Balance 1998.8
    Sendtoaddres dadadadda 0.8
    Balance 0
    After a few confs -> Balance 1998


    ...

    So I can only send ONE transaction and have to wait to get my balance back now ? That was not the case with 0.0.8 and all versions before
     
  4. ceejep

    ceejep Sr. Member
    Developer

    Dec 14, 2015
    192
    220
    The transaction creation code changed in the last version or two. Instead of sendtoaddress use sendfrom with 0 minconf.
    Code:
    sendtoaddress dadadadda 0.8
    becomes

    Code:
    sendfrom default dadadadda 0.8 0
     
    Kandiru likes this.
  5. ocminer

    ocminer Jr. Member
    Pool Operator (PoW)

    Jan 17, 2016
    135
    45
    Male
    This doesn't answer my question nor resolves my Problem
     
  6. zero

    zero Full Member

    Jan 1, 2016
    288
    121
    Male
    #6 zero, Apr 4, 2016
    Last edited: Apr 4, 2016
    @ceejep So it's wrong to use sendtoaddress now for sending DCR to someone? What's the use and differences between sendtoaddress, sendfrom and sendmany? Can you please explain them some more? Maybe @davecgh can help for it too?
     
  7. Shadowlance

    Shadowlance Full Member

    Jan 9, 2016
    220
    155
    Male
    It looks like it answers your question and solves your problem to me.

    Question:
    So I can only send ONE transaction and have to wait to get my balance back now?

    Answer:
    The transaction creation code changed in the last version or two. Instead of sendtoaddress use sendfrom with 0 minconf.

    So sendtoaddress now requires at least one block confirmation. So I can see how this would lock funds in that address since it's part of the transaction that needs a confirmation.

    Problem:
    I can't send more than one transaction without waiting a block for confirmation.

    Solution:
    Instead of sendtoaddress use sendfrom with 0 minconf

    So you use sendfrom now. The last argument is how many confirmations you want to wait. By setting it to 0 you're saying I don't want to wait for the transaction to be confirmed and you can continue to send other transactions.
     
    drunkenmugsy likes this.
  8. ceejep

    ceejep Sr. Member
    Developer

    Dec 14, 2015
    192
    220
    sendfrom sends from a specific account, sendmany sends multiple outputs. Both let you spend from zero conf transactions which sendtoaddress only allows you to spend from transactions with >= 1 confs.
     
    drunkenmugsy and zero like this.
  9. drunkenmugsy

    drunkenmugsy Sr. Member
    Advocate (Reddit)

    Dec 28, 2015
    405
    218
    Male
    Good stuff. This will go into the FAQ! Thanks @ceejep
     

Share This Page