When using the rescanblockchain
wallet RPC command, it seems like sometimes (though not always, and I couldn’t find a specific pattern for when this does and doesn’t happen) the time
field of all transactions found is being set to the time of the most recent transaction detected. Besides that field, all data (including block and blocktime) return correctly. What’s more, even in a node with txindex=1
this happens, despite that when calling the (non-wallet-specific) getrawtransaction
command, it returns the correct time.
Here’s an example of a testnet transaction where I experienced this behaviour, and the output of Core where the same txid
has. 2 different time
s - a correct one using getrawtransaction
and an incorrect one using gettransaction
:
0bitcoin-cli --testnet -rpcwallet=wallet getrawtransaction 8bacfc9c63d181e9d303f57f550fe72870afd640c961466829c6212bb23a72fe 1
1{
2 "txid": "8bacfc9c63d181e9d303f57f550fe72870afd640c961466829c6212bb23a72fe",
3 "hash": "3de22064b8fec52fb183a8ad46fd011e6c6cab9906a008afa3d649d11bd250f1",
4 "version": 2,
5 "size": 222,
6 "vsize": 141,
7 "weight": 561,
8 "locktime": 0,
9 "vin": [
10 {
11 "txid": "685571776adce2ac3332faf6ed125235366cc3cb464604c9234bf371f1ab4e02",
12 "vout": 0,
13 "scriptSig": {
14 "asm": "",
15 "hex": ""
16 },
17 "txinwitness": [
18 "30440220516d0b313aae44f639a111dac8f27bc1fac446345aaad51852a784620ac62c690220433cb7fdeb78cd84574ec0ddd08789a248fe19b71759e1b3b448ff9c3f980be401",
19 "03eca8ceb44c4d930ab89fb5d721d02a745e4aeb0f75993fa535e98fb6c7f6e16e"
20 ],
21 "sequence": 4294967294
22 }
23 ],
24 "vout": [
25 {
26 "value": 0.53891045,
27 "n": 0,
28 "scriptPubKey": {
29 "asm": "0 f3020d45a9ccf870ddf4176fde4420931ffd9af6",
30 "hex": "0014f3020d45a9ccf870ddf4176fde4420931ffd9af6",
31 "reqSigs": 1,
32 "type": "witness_v0_keyhash",
33 "addresses": [
34 "tb1q7vpq63dfenu8ph05zahau3pqjv0lmxhk73dsjm"
35 ]
36 }
37 },
38 {
39 "value": 0.10000000,
40 "n": 1,
41 "scriptPubKey": {
42 "asm": "0 bf702bf755da860153e7b1043fea160c6dcd9f1a",
43 "hex": "0014bf702bf755da860153e7b1043fea160c6dcd9f1a",
44 "reqSigs": 1,
45 "type": "witness_v0_keyhash",
46 "addresses": [
47 "tb1qhaczha64m2rqz5l8kyzrl6skp3kum8c6m0c2h4"
48 ]
49 }
50 }
51 ],
52 "hex": "02000000000101024eabf171f34b23c9044646cbc36c36355212edf6fa3233ace2dc6a777155680000000000feffffff02e54f360300000000160014f3020d45a9ccf870ddf4176fde4420931ffd9af68096980000000000160014bf702bf755da860153e7b1043fea160c6dcd9f1a024730440220516d0b313aae44f639a111dac8f27bc1fac446345aaad51852a784620ac62c690220433cb7fdeb78cd84574ec0ddd08789a248fe19b71759e1b3b448ff9c3f980be4012103eca8ceb44c4d930ab89fb5d721d02a745e4aeb0f75993fa535e98fb6c7f6e16e00000000",
53 "blockhash": "00000000000000bc3b97cbe323c4695f39a65cc1d73060dca8ad084fb0ce61b5",
54 "confirmations": 27528,
55 "time": 1600623861,
56 "blocktime": 1600623861
57}
0bitcoin-cli --testnet -rpcwallet=wallet gettransaction 8bacfc9c63d181e9d303f57f550fe72870afd640c961466829c6212bb23a72fe
1{
2 "amount": -0.10000000,
3 "fee": -0.00000142,
4 "confirmations": 27528,
5 "blockhash": "00000000000000bc3b97cbe323c4695f39a65cc1d73060dca8ad084fb0ce61b5",
6 "blockheight": 1835261,
7 "blockindex": 24,
8 "blocktime": 1600623861,
9 "txid": "8bacfc9c63d181e9d303f57f550fe72870afd640c961466829c6212bb23a72fe",
10 "walletconflicts": [
11 ],
12 "time": 1601486746,
13 "timereceived": 1602570577,
14 "bip125-replaceable": "no",
15 "details": [
16 {
17 "involvesWatchonly": true,
18 "address": "tb1q7vpq63dfenu8ph05zahau3pqjv0lmxhk73dsjm",
19 "category": "send",
20 "amount": -0.53891045,
21 "label": "Change [#5](/bitcoin-bitcoin/5/)",
22 "vout": 0,
23 "fee": -0.00000142,
24 "abandoned": false
25 },
26 {
27 "involvesWatchonly": true,
28 "address": "tb1qhaczha64m2rqz5l8kyzrl6skp3kum8c6m0c2h4",
29 "category": "send",
30 "amount": -0.10000000,
31 "vout": 1,
32 "fee": -0.00000142,
33 "abandoned": false
34 },
35 {
36 "involvesWatchonly": true,
37 "address": "tb1q7vpq63dfenu8ph05zahau3pqjv0lmxhk73dsjm",
38 "category": "receive",
39 "amount": 0.53891045,
40 "label": "Change [#5](/bitcoin-bitcoin/5/)",
41 "vout": 0
42 }
43 ],
44 "hex": "02000000000101024eabf171f34b23c9044646cbc36c36355212edf6fa3233ace2dc6a777155680000000000feffffff02e54f360300000000160014f3020d45a9ccf870ddf4176fde4420931ffd9af68096980000000000160014bf702bf755da860153e7b1043fea160c6dcd9f1a024730440220516d0b313aae44f639a111dac8f27bc1fac446345aaad51852a784620ac62c690220433cb7fdeb78cd84574ec0ddd08789a248fe19b71759e1b3b448ff9c3f980be4012103eca8ceb44c4d930ab89fb5d721d02a745e4aeb0f75993fa535e98fb6c7f6e16e00000000"
45}