error code -6:Internal error negative change amount

+1 vote

Hi guys, 

This is a simple config question.

I Want be able to create N number of Assets with issue command, but how the best approach to config my blockchain to accept that ?

All works fine, it's just to find an solution for that.

Example error flow:

Issue "issue1" - qty:50000000 - Works
Issue "issue2" - qty:50000000 - Works
Issue "issue3" - qty:50000000 - Works
Issue "issue4" - qty:50000000 - Works
.
.
.
Issue "issue26" - qty:50000000 - 6:Internal error negative change amount
Issue "issue27" - qty:5000000 - Works
Issue "issue28" - qty:5000000 - 6:Internal error negative change amount
Issue "issue29" - qty:500000 - Works
Issue "issue30" - qty:500000 - 6:Internal error negative change amount
Issue "issue31" - qty:50000 - Works

My blockchain params - version 1.0.2

{
    "chain-protocol" : "multichain",
    "chain-description" : "xxxxx",
    "root-stream-name" : "root",
    "root-stream-open" : true,
    "chain-is-testnet" : false,
    "target-block-time" : 15,
    "maximum-block-size" : 8388608,
    "default-network-port" : xxxx,
    "default-rpc-port" : xxxx,
    "anyone-can-connect" : true,
    "anyone-can-send" : false,
    "anyone-can-receive" : false,
    "anyone-can-receive-empty" : true,
    "anyone-can-create" : false,
    "anyone-can-issue" : false,
    "anyone-can-mine" : false,
    "anyone-can-activate" : false,
    "anyone-can-admin" : false,
    "support-miner-precheck" : true,
    "allow-arbitrary-outputs" : false,
    "allow-p2sh-outputs" : true,
    "allow-multisig-outputs" : true,
    "setup-first-blocks" : 60,
    "mining-diversity" : 0.30000000,
    "admin-consensus-upgrade" : 0.50000000,
    "admin-consensus-admin" : 0.50000000,
    "admin-consensus-activate" : 0.50000000,
    "admin-consensus-mine" : 0.50000000,
    "admin-consensus-create" : 0.00000000,
    "admin-consensus-issue" : 0.00000000,
    "lock-admin-mine-rounds" : 10,
    "mining-requires-peers" : true,
    "mine-empty-rounds" : 10.00000000,
    "mining-turnover" : 1.00000000,
    "first-block-reward" : -1,
    "initial-block-reward" : 100000000000000,
    "reward-halving-interval" : 60,
    "reward-spendable-delay" : 1,
    "minimum-per-output" : 0,
    "maximum-per-output" : 100000000000000,
    "minimum-relay-fee" : 25, ?
    "native-currency-multiple" : 100000000,
    "skip-pow-check" : false,
    "pow-minimum-bits" : 8,
    "target-adjust-freq" : -1,
    "allow-min-difficulty-blocks" : false,
    "only-accept-std-txs" : true,
    "max-std-tx-size" : 4194304,
    "max-std-op-returns-count" : 10,
    "max-std-op-return-size" : 2097152,
    "max-std-op-drops-count" : 5,
    "max-std-element-size" : 8192,
    "chain-name" : "xxxxx",
    "protocol-version" : 10009,
    "network-message-start" : "f0d0d7f2",
    "address-pubkeyhash-version" : "006e5b21",
    "address-scripthash-version" : "05bf80dd",
    "private-key-version" : "800f1f7d",
    "address-checksum-value" : "2709b1f2",
    "genesis-pubkey" : "02e5cb3d73c07db36fa1f68279a6efef4912d0ce436e3943476c1649d230cc6500",
    "genesis-version" : 1,
    "genesis-timestamp" : 1512844305,
    "genesis-nbits" : 536936447,
    "genesis-nonce" : 99,
    "genesis-pubkey-hash" : "096dcab70ed4b7813aee44fca58bd845d13eddf3",
    "genesis-hash" : "00c44e89f5e36d9c1848797acfac6595ba1603a1e742e6ceedcbcf4323535476",
    "chain-params-hash" : "d4c45a5e24f77d965c659bbb6074ca4fdbe659996605a1870e348cc34f44ee16"
}

All the best.

asked Feb 7, 2018 by Dsouza

3 Answers

+1 vote
Are all these commands being issued from the same node? If not, the problem is simply that, at the time of issuing the command from a node, it does not have enough of the native currency to pay the transaction fee.
answered Feb 7, 2018 by MultiChain
Sorry i forgot to mention that.

Yes this commands are from a single node for while, but there will be more nodes.

To solve i  need to lower the transaction fee?

The doubt about is: I have a lot of native currency in my Master node balance


 "setupblocks": 60,
        "nodeaddress": "xxxxxxx",
        "burnaddress": "xxxxxxx",
        "incomingpaused": false,
        "miningpaused": false,
        "walletversion": 60000,
        "balance": 87495924.60248613,
        "walletdbversion": 2,
        "reindex": false,
        "blocks": 2095,
        "timeoffset": 0,
        "connections": 2,
        "proxy": "",
        "difficulty": 6e-8,
        "testnet": false,
        "keypoololdest": 1517938014,
        "keypoolsize": 2,
        "paytxfee": 0,
        "relayfee": 2.5e-7,
        "errors": ""


Thank you.
Thanks - we discussed this internally. To help us identify and hopefully solve the problem, can you please do the following:

1. Stop multichaind (issue the stop API command)
2. Run multichaind with the following flags:
-shrinkdebugfilesize=20000000 -debug=mcapi -debug=mcatxo -debug=mchn
3. Reproduce the problem.
4. Stop multichaind again.
5. Compress your blockchain directory using zip and send it by email to: multichain dot debug at gmail.

Thanks!
Very weird.

I just stop my blockchain and restart with flag, the error stops... Maybe an simple restart fix ?

I created 2 new Coins with issue command.

Coin1 - 1000000000
"balance": {
            "amount": -1.7e-7,
            "assets": [
                {
                    "name": "bitcoin_hash3_rFfbwL3l",
                    "assetref": "2096-1000-16900",
                    "qty": 1000000000
                }
            ]
        },
        "myaddresses": [
            "1UGw9TMHHfxCRdt1Z9qtBnZriqrd8mH1bL7Dne",
            "xxxxxxxxxxxxxxxxxxxxx"
        ],
        "addresses": [],
        "permissions": [],
        "issue": {
            "name": "bitcoin_hash3_rFfbwL3l",
            "assetref": "2096-1000-16900",
            "multiple": 100,
            "units": 0.01,
            "open": true,
            "details": {
                "details": "{...}"
            },
            "qty": 1000000000,
            "raw": 100000000000,
            "addresses": [
                "1UGw9TMHHfxCRdt1Z9qtBnZriqrd8mH1bL7Dne"
            ]
        },
        "items": [],
        "data": [],
        "confirmations": 17,
        "blockhash": "0003a22bd50e58c075fdad30e7945b11eae97d403efcae098820eff546cec8d4",
        "blockindex": 3,
        "blocktime": 1518094569,
        "txid": "04425704c5e342cfe251b910ba58e17d6d1a09d792c4f2ae8f0185d0e9586e30",
        "valid": true,
        "time": 1518094557,
        "timereceived": 1518094557
    }

Coin2 - 10000000000

"balance": {
            "amount": -1.7e-7,
            "assets": [
                {
                    "name": "bitcoin_hash4_K9S7zdgh",
                    "assetref": "2102-1819-58583",
                    "qty": 10000000000
                }
            ]
        },
        "myaddresses": [
            "1QuXsCrdbYBvRf3fncA7nQGVGyQkeg22Jzbt7n",
            "xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
        ],
        "addresses": [],
        "permissions": [],
        "issue": {
            "name": "bitcoin_hash4_K9S7zdgh",
            "assetref": "2102-1819-58583",
            "multiple": 100,
            "units": 0.01,
            "open": true,
            "details": {
                "details": "{...}"
            },
            "qty": 10000000000,
            "raw": 1000000000000,
            "addresses": [
                "1QuXsCrdbYBvRf3fncA7nQGVGyQkeg22Jzbt7n"
            ]
        },
        "items": [],
        "data": [],
        "confirmations": 2,
        "blockhash": "000f3d5c3c0ec0b95aba58bdfed7f30bca6757b912d877124f88f895424e4ce9",
        "blockindex": 2,
        "blocktime": 1518094626,
        "txid": "d7e43f4b0a4d98761bd74659209d66cc0fc394b2fa589c9fe106d60ad0d71641",
        "valid": true,
        "time": 1518094620,
        "timereceived": 1518094620
    }

But passing an raw amount "1000" to Coin Address before execute issue command for that address.

Now the master node raw balance is:

8749592460248613 - before
8749592460266057 - after

Works very well.

Now i restart with daemon, when the error occurs again i stop the my blockchain again and send the entire directory zipped.

Regards !
OK, thanks - please keep us updated.
Hi guys!
Happened again, i sent to debug email with title "Dsouza Error -6 negative change amount"

OBS: Again after restart blockchain works!

Thank you !
Thanks - we received the file you sent and will take a look.
0 votes

Thanks – we looked at your files and understand the issue. The workaround for now is to use the issuefrom API in which you explicitly state which address should be used for the issue transaction. We will let you know when the problem is resolved in a future release.

answered Feb 25, 2018 by MultiChain
0 votes
Version 1.0.4 of MultiChain, just released, should fix this.
answered Feb 26, 2018 by MultiChain
Hi guys.

Sorry for lag response.

Thank you !
...