work around odd error with payForBlock codegen

This commit is contained in:
Jaremy Creechley 2023-10-31 15:19:49 -07:00 committed by gmega
parent 28593bed1d
commit 94f899b664
No known key found for this signature in database
GPG Key ID: FFD8DAF00660270F
1 changed files with 6 additions and 4 deletions

View File

@ -304,10 +304,12 @@ proc payForBlocks(engine: BlockExcEngine,
sendPayment = engine.network.request.sendPayment
price = peer.price(blocksDelivery.mapIt(it.address))
if payment =? engine.wallet.pay(peer, price):
trace "Sending payment for blocks", price
# echo "sendPayment"
await sendPayment(peer.id, payment)
let payment = engine.wallet.pay(peer, price)
if payment.isErr():
trace "error paying for blocks", price=price
else:
trace "Sending payment for blocks", price=price
await sendPayment(peer.id, payment.get())
proc validateBlockDelivery(
b: BlockExcEngine,