Closed lamengao closed 4 years ago
Interesting. I've just tested the script and I'm not getting the same results for those UTXOs as you are.
I run bitcoin-utxo-dump
on a "raspberry pi 4" and sort the file using sort -k4 -n -r -t, utxodump.txt
.
I guess the reason is my cpu is 32 bits. Change the amount type from int
to int64
can fix the problem.
I guess the reason is my cpu is 32 bits. Change the amount type from
int
toint64
can fix the problem.
Ah yes, thank you, I didn't think of that.
I have changed the code to use int64
instead of int
when working out the amount. Could you update and check that it's working:
go get -u github.com/in3rsha/bitcoin-utxo-dump
To speed up the test you can just ask for the amounts (which saves time on having to work out the addresses for each UTXO):
bitcoin-utxo-dump -f count,txid,vout,amount
You should be getting the following amounts for the UTXOs you listed above:
count,txid,vout,amount
9999824,4f4d5fbae8e4032e04dfe4efb8b7c30d849e2bf4c71eeac6b0f9fbd3bef3fc27,0,1985523766
9999479,36983a7a2bc5b7e197f6c64e40b078a17adffe98e1d9157245f742876d8bfc27,1,46308954412
9999478,36983a7a2bc5b7e197f6c64e40b078a17adffe98e1d9157245f742876d8bfc27,0,9000000000
...
21107494,65fb37015b1ae9e3842c34c9da9a6533dd9ac0b88dad303b1e180a8b68ecfd53,0,2147779575
43986610,a93d8cad6698aa2f6c8f8ff4424a9d090befaaf002ef7f60fa74f9256b7852ae,0,28394799441
20112100,596442355e77fa75d14800750609673e9405f7e96df12bfef5c39bd1a6351150,0,2147677034
I don't have a 32-bit system so I would be grateful for the testing.
I update bitcoin-utxo-dump
and run it again. Right now the amount is all right.
Thank you for your help.
I sorted utxodump.txt by amount and find the maximum amount is 2147483647 and minimum is negative number.