Bitcoin Forum
May 14, 2024, 04:49:21 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin-cli returning negative output of transaction  (Read 289 times)
asketak (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
October 29, 2017, 04:01:42 PM
 #1

Hello, I am running full node and using bitcoin-cli to get data from blockchain.
When I want to get info about this transaction: https://blockchain.info/tx/4c0de1532f0cebb80ebb3a4e787bcd7f512789ab70109307195e697b2c3c25c0?show_adv=true

I run:
Code:
./bitcoin-cli getrawtransaction "4c0de1532f0cebb80ebb3a4e787bcd7f512789ab70109307195e697b2c3c25c0"
To get encoded transaction. When wanting to decode the transaction, I run(parameter is output of previous command):
Code:
 ./bitcoin-cli decoderawtransaction 01000000000101ee00ae484106c1c54b362b6d97c8b141fc7f4dedade3a2dd9edaa1fa2c2317da0100000017160014646abc1ac4bb8b780bc0c7e316629dfc18b8cfeaffffffff01a0d809000000000017a9144d3a3cc3b216b19bd8e6a9d16086b8620826ead98702483045022100ef58e75476f619b6cb4b60588a5d25aab54c29677749c3c33ef4928f0fe6f8c0022060a558b713232917ae623c84e9e615d8848c36abb272ce61df363351ff9ffef701210371104ae352bba2855cc0f0f88f27044b0795e65d01c18b32c7debf8bba09cc6200000000
This will give me
Code:
...
  "vout": [
    {
      "value": -45378677941.16448767,
      "n": 0,
...

I know, that transaction output can not be negative. I get the correct value of output most time when using the method above. Where is the problem? Do you get the same result when running the command?
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715662161
Hero Member
*
Offline Offline

Posts: 1715662161

View Profile Personal Message (Offline)

Ignore
1715662161
Reply with quote  #2

1715662161
Report to moderator
1715662161
Hero Member
*
Offline Offline

Posts: 1715662161

View Profile Personal Message (Offline)

Ignore
1715662161
Reply with quote  #2

1715662161
Report to moderator
1715662161
Hero Member
*
Offline Offline

Posts: 1715662161

View Profile Personal Message (Offline)

Ignore
1715662161
Reply with quote  #2

1715662161
Report to moderator
aleksej996
Sr. Member
****
Offline Offline

Activity: 490
Merit: 389


Do not trust the government


View Profile
October 29, 2017, 04:30:58 PM
 #2

No, I don't get the same result. I get no negative numbers.

Code:
"txid": "4c0de1532f0cebb80ebb3a4e787bcd7f512789ab70109307195e697b2c3c25c0",
  "hash": "3a522ffc32a4d7c845dea08ab38fdc017eff9329febee131036ce6f71d7d6640",
  "version": 1,
  "size": 216,
  "vsize": 134,
  "locktime": 0,
  "vin": [
    {
      "txid": "da17232cfaa1da9edda2e3aded4d7ffc41b1c8976d2b364bc5c1064148ae00ee",
      "vout": 1,
      "scriptSig": {
        "asm": "0014646abc1ac4bb8b780bc0c7e316629dfc18b8cfea",
        "hex": "160014646abc1ac4bb8b780bc0c7e316629dfc18b8cfea"
      },
      "txinwitness": [
        "3045022100ef58e75476f619b6cb4b60588a5d25aab54c29677749c3c33ef4928f0fe6f8c0022060a558b713232917ae623c84e9e615d8848c36abb272ce61df363351ff9ffef701",
        "0371104ae352bba2855cc0f0f88f27044b0795e65d01c18b32c7debf8bba09cc62"
      ],
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 0.00645280,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_HASH160 4d3a3cc3b216b19bd8e6a9d16086b8620826ead9 OP_EQUAL",
        "hex": "a9144d3a3cc3b216b19bd8e6a9d16086b8620826ead987",
        "reqSigs": 1,
        "type": "scripthash",
        "addresses": [
          "38jMiiZs2C5n5MPkyc5pSA7wwW6H4p6hPa"
        ]
      }
    }
  ]
}

Are you running the latest version of Bitcoin Core? This transaction seems to be Segwit transaction so if you are running an older version of Bitcoin Core it might get confused or something.
asketak (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
October 29, 2017, 05:02:04 PM
 #3

You are right, I am running old version of core. Thanks.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!