@@ -456,6 +456,16 @@ func (api *SignerAPI) newAccount() (common.Address, error) {
456456// it also returns 'true' if the transaction was modified, to make it possible to configure the signer not to allow
457457// UI-modifications to requests
458458func logDiff (original * SignTxRequest , new * SignTxResponse ) bool {
459+ var intPtrModified = func (a , b * hexutil.Big ) bool {
460+ aBig := (* big .Int )(a )
461+ bBig := (* big .Int )(b )
462+ if aBig != nil && bBig != nil {
463+ return aBig .Cmp (bBig ) != 0
464+ }
465+ // One or both of them are nil
466+ return a != b
467+ }
468+
459469 modified := false
460470 if f0 , f1 := original .Transaction .From , new .Transaction .From ; ! reflect .DeepEqual (f0 , f1 ) {
461471 log .Info ("Sender-account changed by UI" , "was" , f0 , "is" , f1 )
@@ -469,9 +479,17 @@ func logDiff(original *SignTxRequest, new *SignTxResponse) bool {
469479 modified = true
470480 log .Info ("Gas changed by UI" , "was" , g0 , "is" , g1 )
471481 }
472- if g0 , g1 := big .Int (original .Transaction .GasPrice ), big .Int (new .Transaction .GasPrice ); g0 .Cmp (& g1 ) != 0 {
482+ if a , b := original .Transaction .GasPrice , new .Transaction .GasPrice ; intPtrModified (a , b ) {
483+ log .Info ("GasPrice changed by UI" , "was" , a , "is" , b )
484+ modified = true
485+ }
486+ if a , b := original .Transaction .MaxPriorityFeePerGas , new .Transaction .MaxPriorityFeePerGas ; intPtrModified (a , b ) {
487+ log .Info ("maxPriorityFeePerGas changed by UI" , "was" , a , "is" , b )
488+ modified = true
489+ }
490+ if a , b := original .Transaction .MaxFeePerGas , new .Transaction .MaxFeePerGas ; intPtrModified (a , b ) {
491+ log .Info ("maxFeePerGas changed by UI" , "was" , a , "is" , b )
473492 modified = true
474- log .Info ("GasPrice changed by UI" , "was" , g0 , "is" , g1 )
475493 }
476494 if v0 , v1 := big .Int (original .Transaction .Value ), big .Int (new .Transaction .Value ); v0 .Cmp (& v1 ) != 0 {
477495 modified = true
0 commit comments