Skip to content

Commit

Permalink
Frontend.XF: fix build after merge
Browse files Browse the repository at this point in the history
The merge included a sanity check before tx broadcast [1],
which changed the API, so we need to fix the build in the
XF frontend. Now, this is just a temporary fix short-term
fix, because it is better to crash when this sanity check
fails (just in case geewallet has a bug about not adding
change, for example), but longer term we should handle the
exception and ask the user if he's absolutely sure, like we
did in the Frontend.Console [2].

[1] e08ecb3
[2] aaa8c2e
  • Loading branch information
knocte committed Oct 13, 2023
1 parent 56f2a30 commit ae262f1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/GWallet.Frontend.XF/SendPage.xaml.fs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ type SendPage(account: IAccount, receivePage: Page, newReceivePageFunc: unit->Pa
let lockObject = Object()
let mutable transaction = NotAvailableBecauseOfHotMode

// TODO: this means MinerFeeHigherThanOutputs exception could be thrown (so, crash), handle it
let ignoreMinerFeeHigherThanOutputs = false

let mainLayout = base.FindByName<StackLayout>("mainLayout")
let destinationScanQrCodeButton = mainLayout.FindByName<Button> "destinationScanQrCodeButton"
let transactionScanQrCodeButton = mainLayout.FindByName<Button> "transactionScanQrCodeButton"
Expand Down Expand Up @@ -259,6 +262,7 @@ type SendPage(account: IAccount, receivePage: Page, newReceivePageFunc: unit->Pa
transactionInfo.Destination
transactionInfo.Amount
password
ignoreMinerFeeHigherThanOutputs
|> Async.RunSynchronously |> Some
with
| :? DestinationEqualToOrigin ->
Expand Down Expand Up @@ -726,7 +730,7 @@ type SendPage(account: IAccount, receivePage: Page, newReceivePageFunc: unit->Pa
}
async {
try
let! _ = Account.BroadcastTransaction signedTransaction
let! _ = Account.BroadcastTransaction signedTransaction ignoreMinerFeeHigherThanOutputs
MainThread.BeginInvokeOnMainThread(fun _ ->
Async.StartImmediate afterSuccessfullBroadcastJob
)
Expand Down

0 comments on commit ae262f1

Please sign in to comment.