qrius1111 (OP)
Jr. Member
Offline
Activity: 30
Merit: 1
|
|
November 22, 2015, 01:19:48 PM |
|
i'm having no luck getting bitcoin-cli listtransactions to work for a watch-only address: # pick a random address to watch from blockchain.info: $ addr=1GkktBuJ6Pr51WEJe5ZzyNvMYaMDFjwyDk $ time bitcoin-cli importaddress $addr "$addr" true real 41m59.505s user 0m0.004s sys 0m0.004s $ bitcoin-cli listtransactions "$addr" 100 0 true [ ] $ bitcoin-cli getinfo { "version" : 100200, "protocolversion" : 70002, "walletversion" : 60000, "balance" : 0.00000000, "blocks" : 384806, "timeoffset" : 0, "connections" : 8, "proxy" : "", "difficulty" : 65848255179.70261383, "testnet" : false, "keypoololdest" : 1381701523, "keypoolsize" : 101, "paytxfee" : 0.00000000, "relayfee" : 0.00001000, "errors" : "" }
its only producing an empty list, but blockchain.info shows 6 transactions for this address. is it broken or am i doing something wrong?
|
|
|
|
achow101
Moderator
Legendary
Offline
Activity: 3514
Merit: 6859
Just writing some code
|
|
November 22, 2015, 03:08:14 PM Last edit: November 22, 2015, 09:21:09 PM by knightdk |
|
Listtransactions does not work by address. It works by accounts. The command should instead be bitcoin-cli listtransactions "" 100 0 true Since this command has no defined account, it will list all the transactions for all the addresses in your wallet. EDIT: Sorry, typo. Forgot the quotes.
|
|
|
|
qrius1111 (OP)
Jr. Member
Offline
Activity: 30
Merit: 1
|
|
November 22, 2015, 09:08:51 PM |
|
i know that - that's why i made an account with the name of an address: $ addr=1GkktBuJ6Pr51WEJe5ZzyNvMYaMDFjwyDk $ time bitcoin-cli importaddress $addr "$addr" true i could just as well have done: $ addr=1GkktBuJ6Pr51WEJe5ZzyNvMYaMDFjwyDk $ time bitcoin-cli importaddress $addr "bob" true $ bitcoin-cli listtransactions "bob" 100 0 true and it would be the same. also note that the results of listaddressgroupings confirm this: $ bitcoin-cli listaddressgroupings [ [ [ "1GkktBuJ6Pr51WEJe5ZzyNvMYaMDFjwyDk", 0.00000000, "1GkktBuJ6Pr51WEJe5ZzyNvMYaMDFjwyDk" ] ] ]
|
|
|
|
qrius1111 (OP)
Jr. Member
Offline
Activity: 30
Merit: 1
|
|
November 22, 2015, 09:18:18 PM |
|
Listtransactions does not work by address. It works by accounts. The command should instead be bitcoin-cli listtransactions 100 0 true Since this command has no defined account, it will list all the transactions for all the addresses in your wallet. have you tried running this? when i run it i get the following: $ bitcoin-cli listtransactions 100 0 true error: {"code":-1,"message":"value is type bool, expected int"}
|
|
|
|
gmaxwell
Moderator
Legendary
Offline
Activity: 4256
Merit: 8744
|
|
November 22, 2015, 10:41:00 PM |
|
The empty quotes were not optional, the account name field is missing in your example of trying it.
|
|
|
|
qrius1111 (OP)
Jr. Member
Offline
Activity: 30
Merit: 1
|
|
November 22, 2015, 10:48:29 PM |
|
The empty quotes were not optional, the account name field is missing in your example of trying it.
right, but it still doesn't show me the transactions for that watch-only address: $ bitcoin-cli listtransactions "" 99999 0 true | grep 1GkktBuJ6Pr51WEJe5ZzyNvMYaMDFjwyDk
ie the output is blank. i'm fairly certain it is watching this address though: $ bitcoin-cli listaddressgroupings [ [ [ "1GkktBuJ6Pr51WEJe5ZzyNvMYaMDFjwyDk", 0.00000000, "1GkktBuJ6Pr51WEJe5ZzyNvMYaMDFjwyDk" ] ] ]
|
|
|
|
achow101
Moderator
Legendary
Offline
Activity: 3514
Merit: 6859
Just writing some code
|
|
November 22, 2015, 11:08:08 PM |
|
This is a little confusing. I just tried and imported the address as watching only. List transactions did return some transactions, but not all gave me the receiving transactions.
|
|
|
|
gmaxwell
Moderator
Legendary
Offline
Activity: 4256
Merit: 8744
|
|
November 23, 2015, 02:34:42 AM |
|
You're asking about account "" but you imported the address in account "1GkktBuJ6Pr51WEJe5ZzyNvMYaMDFjwyDk".
|
|
|
|
qrius1111 (OP)
Jr. Member
Offline
Activity: 30
Merit: 1
|
|
November 23, 2015, 02:42:00 AM |
|
i just want to see transaction hashes for account "1GkktBuJ6Pr51WEJe5ZzyNvMYaMDFjwyDk". but like i said at the start, its not working: i'm having no luck getting bitcoin-cli listtransactions to work for a watch-only address: # pick a random address to watch from blockchain.info: $ addr=1GkktBuJ6Pr51WEJe5ZzyNvMYaMDFjwyDk $ time bitcoin-cli importaddress $addr "$addr" true real 41m59.505s user 0m0.004s sys 0m0.004s $ bitcoin-cli listtransactions "$addr" 100 0 true [ ] $ bitcoin-cli getinfo { "version" : 100200, "protocolversion" : 70002, "walletversion" : 60000, "balance" : 0.00000000, "blocks" : 384806, "timeoffset" : 0, "connections" : 8, "proxy" : "", "difficulty" : 65848255179.70261383, "testnet" : false, "keypoololdest" : 1381701523, "keypoolsize" : 101, "paytxfee" : 0.00000000, "relayfee" : 0.00001000, "errors" : "" }
its only producing an empty list, but blockchain.info shows 6 transactions for this address. is it broken or am i doing something wrong?
|
|
|
|
qrius1111 (OP)
Jr. Member
Offline
Activity: 30
Merit: 1
|
|
November 28, 2015, 04:16:22 AM |
|
should i submit a bug report? i wish my knowledge of c++ was better - i could investigate by actually stepping through the code
|
|
|
|
|
luv2drnkbr
|
|
December 08, 2015, 10:38:38 AM |
|
OP, you have to re-scan/re-index. When you import an address, it only sees transactions that happen after you imported it, because as it downloads the blockchain, while it does save the entire blockchain, it only saves in your wallet file data that it knows is relevant to your wallet. So if there were past transactions for an imported address, you have to rescan. Then as it rescans it will see data for the new imported address that it now deems relevant, and that will be saved and available for you to query, after the rescan completes.
|
|
|
|
qrius1111 (OP)
Jr. Member
Offline
Activity: 30
Merit: 1
|
|
January 21, 2016, 06:43:17 AM |
|
Someone may be able to advise better, but just adding the address won't make bitcoind find all historical transactions, you may have to rescan/reindex to get them, which takes time! OP, you have to re-scan/re-index. When you import an address, it only sees transactions that happen after you imported it, because as it downloads the blockchain, while it does save the entire blockchain, it only saves in your wallet file data that it knows is relevant to your wallet. So if there were past transactions for an imported address, you have to rescan. rescanning is what the final argument of importaddress is for: $ bitcoin-cli help importaddress importaddress "address" ( "label" rescan )
Adds an address or script (in hex) that can be watched as if it were in your wallet but cannot be used to spend.
Arguments: 1. "address" (string, required) The address 2. "label" (string, optional, default="") An optional label 3. rescan (boolean, optional, default=true) Rescan the wallet for transactions
if you look at my first post you will see i used the linux "time" command - it took 41 minutes and 59 seconds to import this watch-only address and still failed.
|
|
|
|
CIYAM
Legendary
Offline
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
|
|
January 21, 2016, 06:50:12 AM |
|
Have you tried a "listunspent" (assuming there are UXTOs for the watch only address)?
(I've had no issues using that command with watch only addresses)
|
|
|
|
|