metaspartan / denarius

Denarius [$D] is a PoW/PoS Hybrid Cryptocurrency with Tribus a new PoW Hashing Algo built specifically for D, one of a kind hybrid masternodes called Fortuna Stakes, atomic swaps, staking, mining, IPFS, optional Native Tor and I2P, and much more!
https://denarius.io
MIT License
110 stars 75 forks source link

[masternodes] Can't move any funds from headless deamon wallet #66

Closed inliquid closed 6 years ago

inliquid commented 6 years ago

Already described this a number of times in #testnet@Discord with much more details.

sendtoaddress command doesn't work for almost all external address. It stopped working with fatal error at some point. But has been working previously with this wallet. Last address it worked for was own address.


WHATS IN WALLET:

dnr@dnrftw:~/denarius/src$ ./denariusd listaddressgroupings
[
    [
        [
            "8G13HuUDkxARz3uyapXqiP8vxursWByTfp",
            0.80493118,
            "0"
        ],
        [
            "8c7mWboRNGJUx3ADt4ZtY6E2GWNMtpss1W",
            993.86744695
        ],
        [
            "8JN4xjmfBLhQNezga1CHBPr89pK27bCVq9",
            0.00000000
        ],
        [
            "8TAsK3oQubcwWprW5cF2LHxcjn9AWVcR5V",
            0.01000248
        ],
        [
            "8Hv9ZKewXX3qL15Uspa756jJsH8MzYyeEC",
            0.00000000
        ],
        [
            "8bBdVoLagcfkrhoUvow8swWVqQs1hyuGzv",
            0.00000000
        ],
        [
            "8VLATqw5gpbjSneXUuKSgPbTnZQDVmnDxt",
            0.01000028
        ],
        [
            "8TbuWwofdpYcbFWuTHxdmpk9Vg6EpAgLd6",
            0.01000022
        ],
        [
            "8MDa1kTdBH8jwdsBuTDWXuzSG9bD5m6TUk",
            2.31749939,
            "NewMN"
        ],
        [
            "8HyQ5crgHRFExheFVcNsWNsK1SeBQpaAfh",
            0.00000000
        ],
        [
            "8XXJsJ5Q4KjkZQXrbF4x6FnK2m7X58SdHN",
            0.00000000
        ],
        [
            "8GgrVUJWv7wnezCcQ7P479hz8ihjjj35py",
            0.11000000
        ],
        [
            "8b9UmmtU2jciWDmYfNLG9Ayt1QhP1NaLCw",
            3000.00000000,
            "test"
        ]
    ]
]

THE ERROR

dnr@dnrftw:~/denarius/src$ ./denariusd getbalance
3997.12988050
dnr@dnrftw:~/denarius/src$ ./denariusd sendtoaddress 8TMCocpdg481PFRgc88KzTRTeuX2q9Msz7 3997
error: {"code":-4,"message":"Error: Transaction creation failed  "}
dnr@dnrftw:~/denarius/src$

LOGS:

02/22/18 20:42:36 ThreadRPCServer method=sendtoaddress
02/22/18 20:42:36 selectcoinsselectcoinsselectcoinsSendMoney() : Error: Transaction creation failed
metaspartan commented 6 years ago

Your funds are more than likely locked for masternode.

inliquid commented 6 years ago

5k are locked in another wallet this one holds only 3+k as you may see(edited) I also tried by disabling all related to MN stuff and then enabling it with no result

inliquid commented 6 years ago

@carsenk your fucking wallet still doesn't work, even with this "magic" command resendtx

3.12974050
dnr@dnrftw:~/denarius/src$ ./denariusd sendtoaddress 8TMCocpdg481PFRgc88KzTRTeuX2q9Msz7 3.12973050
error: {"code":-4,"message":"Error: Transaction creation failed  "}
dnr@dnrftw:~/denarius/src$ ./denariusd sendtoaddress 8TMCocpdg481PFRgc88KzTRTeuX2q9Msz7 3
error: {"code":-4,"message":"Error: Transaction creation failed  "}
dnr@dnrftw:~/denarius/src$ ./denariusd resendtx
dnr@dnrftw:~/denarius/src$ ./denariusd sendtoaddress 8TMCocpdg481PFRgc88KzTRTeuX2q9Msz7 3
error: {"code":-4,"message":"Error: Transaction creation failed  "}
dnr@dnrftw:~/denarius/src$ ./denariusd resendtx
dnr@dnrftw:~/denarius/src$ ./denariusd sendtoaddress 8TMCocpdg481PFRgc88KzTRTeuX2q9Msz7 3
error: {"code":-4,"message":"Error: Transaction creation failed  "}
dnr@dnrftw:~/denarius/src$ ./denariusd resendtx
dnr@dnrftw:~/denarius/src$ ./denariusd sendtoaddress 8TMCocpdg481PFRgc88KzTRTeuX2q9Msz7 3
error: {"code":-4,"message":"Error: Transaction creation failed  "}
dnr@dnrftw:~/denarius/src$ ./denariusd resendtx
dnr@dnrftw:~/denarius/src$ ./denariusd sendtoaddress 8TMCocpdg481PFRgc88KzTRTeuX2q9Msz7 3
error: {"code":-4,"message":"Error: Transaction creation failed  "}
dnr@dnrftw:~/denarius/src$
metaspartan commented 6 years ago

Any coin/cryptocurrency will do this with transactions if the number of inputs needed to add up to that much causes the transaction to be just too big. resendtx is to attempt to resend the transactions that are pending in the mempool in the wallet, you are running a JSON RPC command to attempt to send funds, getting the Transaction Creation Failed error is a normal typical error response and is 100% expected it the CreateTransaction() fails in a random way (transaction being too big). If you have the technical ability, you could potentially use createrawtransaction and combine the dust outputs you have with a larger non-dust outputs in a free transaction. After several iterations, all of the dust would eventually be swept up.

Note that if you don't know what you are doing, it is possible with createrawtransaction to accidentally pay a significant portion of your transaction as a transaction fee.

If you are confused as to why this is happening, here are some threads that may help to explain it some to you: https://bitcointalk.org/index.php?topic=218447.0 https://bitcointalk.org/index.php?topic=196330.0 https://bitcointalk.org/index.php?topic=89532.0 https://bitcointalk.org/index.php?topic=104641.0

metaspartan commented 6 years ago

Another solution to this for you, would be to potentially load up this wallet.dat into a QT and use Coin Control to tidy up your inputs or even attempt to just export the private keys for the addresses with funds and reimport them into a new wallet.dat.

inliquid commented 6 years ago

So what should I do in this situation? Imagine I have real coins on mainnet and fail with sending them out or this will happen on Exchange. I still getting errors.

dnr@dnrftw:~/denarius/src$ ./denariusd sendtoaddress 8TMCocpdg481PFRgc88KzTRTeuX2q9Msz7 3
error: {"code":-4,"message":"Error: Transaction creation failed  "}