mirror of
https://github.com/aljazceru/cyphernode.git
synced 2025-12-18 05:05:12 +01:00
Fixed a glitch in 1-conf miss
This commit is contained in:
@@ -41,7 +41,7 @@ manage_missed_conf() {
|
||||
|
||||
trace "[Entering manage_missed_conf()]"
|
||||
|
||||
local watches=$(sql "SELECT DISTINCT address FROM watching w LEFT JOIN watching_tx ON w.id = watching_id LEFT JOIN tx t ON t.id = tx_id WHERE watching AND imported AND (tx_id IS NULL OR t.confirmations=0) ORDER BY address")
|
||||
local watches=$(sql "SELECT DISTINCT address FROM watching w LEFT JOIN watching_tx ON w.id = watching_id LEFT JOIN tx t ON t.id = tx_id WHERE watching AND imported ORDER BY address")
|
||||
trace "[manage_missed_conf] watches=${watches}"
|
||||
if [ ${#watches} -eq 0 ]; then
|
||||
trace "[manage_missed_conf] Nothing missed!"
|
||||
@@ -122,8 +122,10 @@ manage_missed_conf() {
|
||||
trace "[manage_missed_conf] confirmations=${confirmations}"
|
||||
|
||||
if [ "${txtime}" -ge "${inserted_ts}" ]; then
|
||||
# Broadcast after watch, we missed it!
|
||||
trace "[manage_missed_conf] Mined after watch, we missed it!"
|
||||
# Broadcast or mined after watch, we missed it!
|
||||
trace "[manage_missed_conf] Broadcast or mined after watch, we missed it!"
|
||||
# We skip the callbacks because do_callbacks is called right after in
|
||||
# requesthandler.executecallbacks (where we're from)
|
||||
confirmation "${latesttxid}" "true"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -116,8 +116,8 @@ test_manage_missed_1_conf() {
|
||||
docker exec -it $(docker ps -q -f "name=cyphernode_bitcoin") bitcoin-cli -rpcwallet=spending01.dat sendtoaddress ${address} 0.0001
|
||||
# txid1=$(exec_in_test_container curl -d '{"address":"'${address}'","amount":0.0001}' proxy:8888/spend | jq -r ".txid")
|
||||
|
||||
trace 3 "[test_manage_missed_1_conf] Sleeping for 10 seconds to let the 0-conf callbacks to happen..."
|
||||
sleep 10
|
||||
trace 3 "[test_manage_missed_1_conf] Sleeping for 20 seconds to let the 0-conf callbacks to happen..."
|
||||
sleep 20
|
||||
|
||||
trace 3 "[test_manage_missed_1_conf] Shutting down the proxy..."
|
||||
docker stop $(docker ps -q -f "name=proxy\.")
|
||||
|
||||
Reference in New Issue
Block a user