crypto-power/cryptopower

dextest: btc transactions do not get confirms.

Closed this issue · 3 comments

This is specifically for the network --network=dextest, btc transactions never get confirms. I suspect I missed something when adding it to do with the network.

I also was able to hit a panic, unsure if it's connected but recording here anyhow:

2024-03-20 14:21:09.938 [INF] BTC: Inserting unconfirmed transaction 479a2d1c21ae6ed2bed68c320a34d19c76d89b5c6da5d9ffe0fe7c42ec288643
2024-03-20 14:21:19.112 [INF] BTC: Current sync progress update is on block 675, target sync block is 675
2024-03-20 14:21:34.120 [INF] BTC: Current sync progress update is on block 676, target sync block is 676
2024-03-20 14:21:49.130 [INF] BTC: Current sync progress update is on block 677, target sync block is 677
2024-03-20 14:22:04.141 [INF] BTC: Current sync progress update is on block 678, target sync block is 678
2024-03-20 14:22:09.947 [INF] BTC: Inserting unconfirmed transaction 7f25ce701576de78b34d57806c403fb2a49b67dfebed6a273344bd9fe06c6569
2024-03-20 14:22:19.150 [INF] BTC: Current sync progress update is on block 679, target sync block is 679
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x98 pc=0x12291d6]

goroutine 27 [running]:
github.com/crypto-power/cryptopower/libwallet/assets/btc.(*Asset).lockedAmount(0xc0030a5320)
        /home/joe/git/cryptopower/libwallet/assets/btc/accounts.go:136 +0x36
github.com/crypto-power/cryptopower/libwallet/assets/btc.(*Asset).GetAccountBalance(0xc0030a5320, 0x0)
        /home/joe/git/cryptopower/libwallet/assets/btc/accounts.go:113 +0x8a
github.com/crypto-power/cryptopower/libwallet/assets/btc.(*Asset).GetAccountsRaw(0xc0030a5320)
        /home/joe/git/cryptopower/libwallet/assets/btc/accounts.go:57 +0x125
github.com/crypto-power/cryptopower/libwallet.(*AssetsManager).CalculateTotalAssetsBalance(0xc002cd89a0, 0x1)
        /home/joe/git/cryptopower/libwallet/assets_manager.go:808 +0xc6
github.com/crypto-power/cryptopower/ui/page/root.(*HomePage).CalculateAssetsUSDBalance(0xc00381e340)
        /home/joe/git/cryptopower/ui/page/root/home_page.go:1047 +0x5a
github.com/crypto-power/cryptopower/libwallet/ext.(*CommonRateSource).notifyRateListeners(0xc0030a5560?)
        /home/joe/git/cryptopower/libwallet/ext/rate_source.go:480 +0xe2
github.com/crypto-power/cryptopower/libwallet/ext.(*CommonRateSource).startWebsocket.func1()
        /home/joe/git/cryptopower/libwallet/ext/rate_source.go:393 +0xc5
created by github.com/crypto-power/cryptopower/libwallet/ext.(*CommonRateSource).startWebsocket in goroutine 50
        /home/joe/git/cryptopower/libwallet/ext/rate_source.go:346 +0x94

error on shutdown, maybe related:

^C2024-03-20 16:21:04.708 [INF] UI: ...Initiating the app shutdown protocols...
2024-03-20 16:21:04.708 [INF] UI: Displaying the shutdown wallets view page
2024-03-20 16:21:04.708 [INF] DLWL: Shutting down libwallet
2024-03-20 16:21:04.708 [INF] BTC: Canceling sync. May take a while for sync to fully cancel.
2024-03-20 16:21:04.709 [INF] BTC: (bet) SPV wallet closed
2024-03-20 16:21:04.937 [ERR] UI: database not open
2024-03-20 16:21:04.953 [ERR] UI: database not open
2024-03-20 16:21:05.522 [ERR] UI: database not open
2024-03-20 16:21:05.692 [ERR] UI: database not open
2024-03-20 16:21:06.164 [ERR] UI: database not open
2024-03-20 16:21:06.523 [ERR] UI: database not open
2024-03-20 16:21:06.687 [ERR] UI: database not open
2024-03-20 16:21:06.777 [ERR] UI: database not open
2024-03-20 16:21:07.116 [INF] BTC: Stopping (bet) wallet and its neutrino interface
2024-03-20 16:21:07.116 [INF] SHWL: (bet) full network shutdown protocols completed.
2024-03-20 16:21:07.116 [INF] DLWL: db closed successfully
2024-03-20 16:21:07.116 [INF] DLWL: Shutting down log rotator
2024-03-20 16:21:07.116 [INF] DLWL: Shutdown log rotator successfully

It does see incoming txn though and they do get confirms.

It randomly works. Look at these three transactions, to the same address, the first two seen and the last one not

2024-03-20 17:18:41.976 [INF] BTC: Current sync progress update is on block 1384, target sync block is 1384
2024-03-20 17:18:56.989 [INF] BTC: Current sync progress update is on block 1385, target sync block is 1385
2024-03-20 17:19:12.003 [INF] BTC: Current sync progress update is on block 1386, target sync block is 1386
2024-03-20 17:19:25.912 [INF] BTC: The wallet has been temporarily unlocked
2024-03-20 17:19:25.913 [INF] BTC: Inserting unconfirmed transaction d542d5682f77aea8749616f68cefc7de9a6e36215661ce0fc173a5f5f0cd1aac
2024-03-20 17:19:25.913 [ERR] BTC: Notifying unmined tx notification (d542d5682f77aea8749616f68cefc7de9a6e36215661ce0fc173a5f5f0cd1aac) while creating notification for blocks
2024-03-20 17:19:27.014 [INF] BTC: Current sync progress update is on block 1387, target sync block is 1387
2024-03-20 17:19:30.917 [INF] BTC: The wallet has been locked
2024-03-20 17:19:42.026 [INF] BTC: Marking unconfirmed transaction d542d5682f77aea8749616f68cefc7de9a6e36215661ce0fc173a5f5f0cd1aac mined in block 1388
2024-03-20 17:19:42.027 [INF] BTC: Current sync progress update is on block 1388, target sync block is 1388
2024-03-20 17:19:57.039 [INF] BTC: Current sync progress update is on block 1389, target sync block is 1389
2024-03-20 17:20:12.050 [INF] BTC: Current sync progress update is on block 1390, target sync block is 1390
2024-03-20 17:20:27.078 [INF] BTC: Current sync progress update is on block 1391, target sync block is 1391
2024-03-20 17:20:42.076 [INF] BTC: Current sync progress update is on block 1392, target sync block is 1392
2024-03-20 17:20:57.086 [INF] BTC: Current sync progress update is on block 1393, target sync block is 1393
2024-03-20 17:21:12.100 [INF] BTC: Current sync progress update is on block 1394, target sync block is 1394
2024-03-20 17:21:24.457 [INF] BTC: The wallet has been temporarily unlocked
2024-03-20 17:21:24.457 [INF] BTC: Inserting unconfirmed transaction 4e3c41dfb7d9e4e4a45ea6398e798613779bfe6a2d1d82dc8a726cacf6e29d4f
2024-03-20 17:21:24.458 [ERR] BTC: Notifying unmined tx notification (4e3c41dfb7d9e4e4a45ea6398e798613779bfe6a2d1d82dc8a726cacf6e29d4f) while creating notification for blocks
2024-03-20 17:21:27.111 [INF] BTC: Current sync progress update is on block 1395, target sync block is 1395
2024-03-20 17:21:29.512 [INF] BTC: The wallet has been locked
2024-03-20 17:21:42.123 [INF] BTC: Current sync progress update is on block 1396, target sync block is 1396
2024-03-20 17:21:42.123 [INF] BTC: Marking unconfirmed transaction 4e3c41dfb7d9e4e4a45ea6398e798613779bfe6a2d1d82dc8a726cacf6e29d4f mined in block 1396
2024-03-20 17:21:57.134 [INF] BTC: Current sync progress update is on block 1397, target sync block is 1397
2024-03-20 17:22:12.145 [INF] BTC: Current sync progress update is on block 1398, target sync block is 1398
2024-03-20 17:22:27.157 [INF] BTC: Current sync progress update is on block 1399, target sync block is 1399
2024-03-20 17:22:42.170 [INF] BTC: Current sync progress update is on block 1400, target sync block is 1400
2024-03-20 17:22:57.191 [INF] BTC: Current sync progress update is on block 1401, target sync block is 1401
2024-03-20 17:23:12.192 [INF] BTC: Current sync progress update is on block 1402, target sync block is 1402
2024-03-20 17:23:27.203 [INF] BTC: Current sync progress update is on block 1403, target sync block is 1403
2024-03-20 17:23:42.216 [INF] BTC: Current sync progress update is on block 1404, target sync block is 1404
2024-03-20 17:23:46.402 [INF] BTC: The wallet has been temporarily unlocked
2024-03-20 17:23:46.402 [INF] BTC: Inserting unconfirmed transaction d23a79fd6136c1bf6ab1a8ca7071c6a174a9bcfe9d68c56c786758922fca1fd5
2024-03-20 17:23:51.407 [INF] BTC: The wallet has been locked
2024-03-20 17:23:57.227 [INF] BTC: Current sync progress update is on block 1405, target sync block is 1405
2024-03-20 17:24:12.235 [INF] BTC: Current sync progress update is on block 1406, target sync block is 1406
2024-03-20 17:24:27.246 [INF] BTC: Current sync progress update is on block 1407, target sync block is 1407
2024-03-20 17:24:42.259 [INF] BTC: Current sync progress update is on block 1408, target sync block is 1408
2024-03-20 17:24:57.271 [INF] BTC: Current sync progress update is on block 1409, target sync block is 1409

But the last transaction d23a79fd6136c1bf6ab1a8ca7071c6a174a9bcfe9d68c56c786758922fca1fd5 was mined in 1405 according to the node. Perhaps it's a problem with being mined "too fast". In that case it's probably a real problem that could happen on mainnet.

After restoring from seed the last transaction is seen. Also rescan never ends which may be an issue...