@@ -924,6 +924,21 @@ func bitcoinHandler(w http.ResponseWriter, r *http.Request) {
924924 eta = "Past due"
925925 }
926926
927+ client , cleanup , err := ps .GetClient (config .Config .RpcHost )
928+ if err != nil {
929+ redirectWithError (w , r , "/config?" , err )
930+ return
931+ }
932+ defer cleanup ()
933+
934+ res , err := ps .ListPeers (client )
935+ if err != nil {
936+ log .Printf ("unable to connect to RPC server: %v" , err )
937+ redirectWithError (w , r , "/config?" , err )
938+ return
939+ }
940+ peers := res .GetPeers ()
941+
927942 data := Page {
928943 Authenticated : config .Config .SecureConnection && config .Config .Password != "" ,
929944 ErrorMessage : errorMessage ,
@@ -952,7 +967,7 @@ func bitcoinHandler(w http.ResponseWriter, r *http.Request) {
952967 BitcoinAddress : addr ,
953968 AdvertiseEnabled : ln .AdvertiseBitcoinBalance ,
954969 BitcoinSwaps : config .Config .BitcoinSwaps ,
955- CanClaimJoin : hasDiscountedvSize ,
970+ CanClaimJoin : hasDiscountedvSize && len ( peers ) > 0 ,
956971 IsClaimJoin : config .Config .PeginClaimJoin ,
957972 ClaimJoinStatus : ln .ClaimStatus ,
958973 HasClaimJoinPending : ln .ClaimJoinHandler != "" ,
@@ -1174,12 +1189,10 @@ func peginHandler(w http.ResponseWriter, r *http.Request) {
11741189
11751190 if isPegin {
11761191 log .Println ("New Peg-in TxId:" , res .TxId , "RawHex:" , res .RawHex , "Claim script:" , claimScript )
1177- duration := time .Duration (10 * peginBlocks ) * time .Minute
1178- eta := time .Now ().Add (duration ).Format ("3:04 PM" )
1179- telegramSendMessage (fmt .Sprintf ("⏰ Started peg in %s sats, fee rate: %0.2f s/vb, ETA: %s, TxId: `%s`" , formatWithThousandSeparators (uint64 (res .AmountSat )), config .Config .PeginFeeRate , eta , res .TxId ))
1192+ telegramSendMessage (fmt .Sprintf ("⏰ Started peg in %s sats, fee rate: %0.2f s/vb, TxId: `%s`" , formatWithThousandSeparators (uint64 (res .AmountSat )), res .ExactSatVb , res .TxId ))
11801193 } else {
11811194 log .Println ("BTC withdrawal pending, TxId:" , res .TxId , "RawHex:" , res .RawHex )
1182- telegramSendMessage (fmt .Sprintf ("⛓️ BTC withdrawal pending: %s sats, fee rate: %0.2f s/vb, TxId: `%s`" , formatWithThousandSeparators (uint64 (res .AmountSat )), config . Config . PeginFeeRate , res .TxId ))
1195+ telegramSendMessage (fmt .Sprintf ("⛓️ BTC withdrawal pending: %s sats, fee rate: %0.2f s/vb, TxId: `%s`" , formatWithThousandSeparators (uint64 (res .AmountSat )), res . ExactSatVb , res .TxId ))
11831196 }
11841197 config .Config .PeginAmount = res .AmountSat
11851198 config .Config .PeginTxId = res .TxId
@@ -1630,7 +1643,7 @@ func updateHandler(w http.ResponseWriter, r *http.Request) {
16301643 swapData += swap .Id
16311644 swapData += `</td></tr>
16321645 <tr><td style="text-align: right">Created At:</td><td >`
1633- swapData += time .Unix (swap .CreatedAt , 0 ).UTC (). Format ("2006-01-02 15:04:05" )
1646+ swapData += time .Unix (swap .CreatedAt , 0 ).Format ("2006-01-02 15:04:05" )
16341647 swapData += `</td></tr>
16351648 <tr><td style="text-align: right">Asset:</td><td>`
16361649 swapData += swap .Asset
@@ -2112,9 +2125,7 @@ func submitHandler(w http.ResponseWriter, r *http.Request) {
21122125 ln .ClaimStatus = "Awaiting funding tx to confirm"
21132126
21142127 log .Println ("External Funding TxId:" , txid )
2115- duration := time .Duration (10 * (int32 (peginBlocks )- tx .Confirmations )) * time .Minute
2116- eta := time .Now ().Add (duration ).Format ("3:04 PM" )
2117- telegramSendMessage ("⏰ Started peg in " + formatWithThousandSeparators (uint64 (config .Config .PeginAmount )) + " sats. ETA: " + eta + ". TxId: `" + txid + "`" )
2128+ telegramSendMessage ("⏰ Started peg in " + formatWithThousandSeparators (uint64 (config .Config .PeginAmount )) + " sats. External funding TxId: `" + txid + "`" )
21182129 }
21192130
21202131 config .Save ()
0 commit comments