-
Notifications
You must be signed in to change notification settings - Fork 492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add canceltransaction
RPC method
#11536
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tack 937e649
var mempoolStore = Global.BitcoinStore.TransactionStore.MempoolStore; | ||
if (!mempoolStore.TryGetTransaction(txId, out var smartTransactionToCancel)) | ||
{ | ||
throw new NotSupportedException($"Unknown transaction {txId}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Would ArgumentException
be better? Or does throwing NotSupportedException
lead to some interesting behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be. There is another issue to fix the error reporting code. I still don't know exactly how but I will take this there.
@@ -220,6 +220,23 @@ public async Task<object> SendTransactionAsync(PaymentInfo[] payments, OutPoint[ | |||
}; | |||
} | |||
|
|||
[JsonRpcMethod("canceltransaction")] | |||
public string BuildCancelTransaction(uint256 txId, string password = "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(note to self: This somewhat makes it look like we succeed in case the parameters are correct but it might still fail because the cancellation would be too expensive AFAIK. Not sure how expected that is but hopefully we will document it in the RPC documentation)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
937e649
to
adad158
Compare
This PR adds the
canceltransaction
RPC method which received the hash of the transaction to be cancelled and returns the raw transaction that cancels the previous tx.This one and #11537 close: #11500