JSON-RPC callback #20

issue mikegogulski opened this issue on January 5, 2011
  1. mikegogulski commented at 9:47 AM on January 5, 2011: none

    (from http://www.bitcoin.org/smf/index.php?topic=1872.0)

    Allow extra parameters to be attached to an address/account at creation and modified later:

    • $uri: JSON-RPC callback URI
    • $total: Transaction total in BTC
    • $timeout: Transaction expiration interval (sec)
    • $minconf: Transaction minimum confirmations required
    • $cert: PEM certificate for callback target server

    Additional options passed in should also cover these use cases:

    Fire $uri, including parameters for the current balance and the most recent payment received, when:

    • Any payment is received to the address/account with $minconf confirmations.
    • Balance on address/account >= $total with $minconf confirmations.
    • $timeout expires without balance on address/account >= $total and without at least $minconf confirmations.

    With this, bitcoind is ready to become a fully-fledged payment back-end for internet commerce.

  2. gavinandresen commented at 7:40 PM on January 6, 2011: contributor

    I'm proposing a simpler api; see http://www.bitcoin.org/smf/index.php?topic=2647.0

    I believe you can build what you want on top of the lower-level "tell me when there are new blocks and transactions".

    For example, note the transaction ID when you get notified of a new transaction. Then when you get notified of new blocks, call gettransaction <txid> to get the status of transactions that had fewer than $minconf confirmations.

  3. mikegogulski commented at 7:51 PM on January 6, 2011: none

    Hey Gavin,

    I can see there would be applications for what you're doing with that API.

    Seems like it would be painful to work with for e-commerce, though. Right now I can just poll an account/label linked to an open purchase order to check the balance and confirmations. Using this API would require (I think) responding to the JSON-RPC callback POST by sending a flurry of RPC calls to check on the each of the transactions in the new block. Given the complexity and traffic involved in that, I'd probably just continue to use periodic polling.

  4. gavinandresen commented at 1:10 AM on January 7, 2011: contributor

    You could replace polling every N minutes with a monitorblocks callback that did what you are doing now-- because you know that transactions won't get more confirmations unless new blocks have been received. You should end up with more accurate results (you'll update as soon as bitcoind sees a new block) with less polling.

    You would probably ignore the transactions in the block, unless you want to do something with 1-confirmation transactions.

  5. mikegogulski commented at 1:29 AM on January 7, 2011: none

    I see how it could work, sure. But the sample JSON output you provided on the forum post showed the callback passing some general block info and then simply a list of transaction IDs.

    For each transaction ID, I would have to determine if it's relevant to my open orders, then check each relevant transaction for the number of confirmations and the balance on the associated account/address in the wallet. Right now that would mean one RPC method call per transaction in the block.

    Unless monitorblocks is going to cough up some per-transaction data correlating transactions with accounts/addresses, I can't see an advantage to using it over polling.

    Actually, maybe I'm totally missing something. The current implementation of gettransaction returns something like:

    $ bitcoind gettransaction 270d70635927aac5ec9b42fda27e539ae50a7a06bc3bb2fb98e086e11446a3e6
    {
    "amount" : -0.02000000,
    "fee" : 0.00000000,
    "confirmations" : 248,
    "txid" : "270d70635927aac5ec9b42fda27e539ae50a7a06bc3bb2fb98e086e11446a3e6",
    "message" : "comment",
    "to" : "comment-to"
    }
    

    How do I associate this with an account or address?

  6. gavinandresen commented at 2:38 AM on January 8, 2011: contributor

    I submitted a pull request today to add "details" to gettransaction output. You'll get one or more objects that give category (send or receive), account, and address.

  7. laanwj referenced this in commit 3f0816e3d9 on Sep 18, 2011
  8. gavinandresen closed this on Apr 4, 2012

  9. namecoin-qt referenced this in commit f47518c328 on Jun 13, 2013
  10. kac- referenced this in commit 6b78b89536 on Mar 25, 2014
  11. justmoon referenced this in commit bfbe3b4441 on Apr 7, 2014
  12. justmoon referenced this in commit eeaffa891d on Apr 7, 2014
  13. rdponticelli referenced this in commit 3bc866b88f on Nov 26, 2014
  14. rubensayshi referenced this in commit 7345bbe452 on Mar 16, 2015
  15. braydonf referenced this in commit 645ae33bec on Jun 28, 2016
  16. luke-jr referenced this in commit 3a051b88a7 on Jun 19, 2017
  17. KrzysiekJ referenced this in commit 6ed383e932 on Mar 28, 2018
  18. effectsToCause referenced this in commit b159b8be15 on Jun 22, 2018
  19. Warchant referenced this in commit 7958da26e8 on Dec 31, 2019
  20. KolbyML referenced this in commit 2a007e3ba5 on Aug 1, 2020
  21. jonasschnelli referenced this in commit 9453fbf5a0 on Oct 22, 2020
  22. laanwj referenced this in commit 924a4ff7eb on Oct 29, 2020
  23. rajarshimaitra referenced this in commit 0a12889659 on Mar 23, 2021
  24. MarcoFalke referenced this in commit bce09da122 on Apr 28, 2021
  25. MarcoFalke referenced this in commit eb9a1fe037 on May 7, 2021
  26. MarcoFalke referenced this in commit c857148636 on May 15, 2021
  27. rajarshimaitra referenced this in commit 429ea51284 on Aug 5, 2021
  28. MarcoFalke locked this on Sep 8, 2021
Labels
Linked (view graph)
#737 Deadlock during startup (Appears to be AddAddress / DNSSeed related)#982 Startup blocks on mutex at "Loading Addresses"#999 v0.6.0rc5 segfault on initial blockchain download when out of diskspace#1098 segfault in qrcode message dialog#2472 System error: database corrupted: void boost::recursive_mutex::lock(): Assertion `!pthread_mutex_lock(&m)' failed#5698 Code vulnerable to segfault after a network fork#5795 Bizarre test_bitcoin crash, but passes in debugger#6332 Segmentation fault on bitcoind or bitcoin-qt startup (64bit Linux)#6540 scheduler_tests (currently disabled) occasionally deadlocks#8984 GUI hangs during sync#9348 Node crashed with assertion failure in network code#9687 bitcoin-qt crashed in FinalizeNode()#9759 Setting -maxsigcachesize to zero causes segfault#9883 [Qt] Segfault on startup#9997 Running out of disk space during GUI init results in hang and non-drawing windows#10209 Stalled shutdown#10293 SEGV in segwit fundrawtransaction#10861 Segfault on shutdown after pressing 'q' to postpone utxo db upgrade#11355 LevelDB read failure: Corruption: block checksum mismatch#11763 deadlock on shutdown#12038 deadlock on database corruption#13316 make check fails for configure option --with-incompatible-bdb and Berkeley DB 5.3#14330 [tests] segfault during`DEBUG=1` run of existing_data_no_obfuscate locally#14349 mac: make check failure on macOS 10.14#14923 segmentation fault on gui startup#15227 bitcoind terminated with uncaught exception if configure --debug-enabled#15379 bitcoind crashes after exception in scheduler thread#17540 ci build fails in ./qt/test/test_bitcoin-qt on aarch64 native tsan#18362 gui: segfault unloading and immediately reloading wallet with gui#19024 UB: double lock of mutex in init.cpp#20163 TSAN race after merge of #20090#20242 fuzz: Properly initialize PrecomputedTransactionData#20542 Unexpected test fail: wallet/wallet.cpp:3113:51: runtime error: division by zero#20618 Data race in interface_zmq.py#21466 Avoid use of "socket" syscall when formatting IP addresses in CNetAddr::ToString#21632 MemorySanitizer: use-of-uninitialized-value in sqlite3BtreeOpen#21773 fuzz: Ensure prevout is consensus-valid#21802 refactor: Avoid UB in util/asmap (advance a dereferenceable iterator outside its valid range)#21948 test: Fix off-by-one in mockscheduler test RPC#22548 CheckQueue_Correct_Random data race#23321 bitcoind segfault's while loading tr descriptor on regtest v22.0#24290 segfault when compiled with depends DEBUG=1 and libc++#24426 test: Fix intermittent Tsan issue#25146 Starting with an unsupported wallet configured leads to a segfault (master only?)#25323 miniscript fuzzer failing after qa-assets update#25365 ThreadSanitizer: data race on vptr (ctor/dtor vs virtual call) in BaseIndex#25632 SUMMARY: ThreadSanitizer: SEGV src/index/base.cpp:388:9 in BaseIndex::SetBestBlockIndex(CBlockIndex const*)::$_1::operator()() const#25857 IBD core dumped during recursive call to CCoinsViewCache::FetchCoin (while connecting best chain tip)#26068 Segmentation fault in the scheduler thread when an index fails to commit to the db#26274 bitcoind dumps core when deriveaddresses is called with index 2147483647 (2^31-1)#26477 validation: fix broken maxtipage comparison#27222 test: use-of-uninitialized-value in sqlite3Strlen30#27354 wallet: Data race in GetOrCreateLegacyScriptPubKeyMan vs IsMine#27355 index: ThreadSanitizer: data race on vptr #27360 ci: use LLVM/clang-16 in native_asan job#27582 TSAN: lock-order-inversion (potential deadlock) in ZapSelectTx test#27922 ci: fix llvm-symbolizer in MSAN jobs#28510 migratewallet crashes on an freshly created datadir ( wallet/wallet.h:959: int wallet::CWallet::GetLastBlockHeight() const: Assertion `m_last_block_processed_height >= 0' failed.)#28665 'std::out_of_range' crash in I2P fuzz test#28917 fuzz, parse_iso8601: attempt to dereference an end-of-stream istreambuf_iterator#28969 fuzz: Avoid signed-integer-overflow in wallet_notifications fuzz target#29153 new crash in v26.0#29178 ubsan: misaligned-pointer-use in crc32c/src/crc32c_arm64.cc#29767 ThreadSanitizer: data race src/flatfile.cpp:47:13 in FlatFileSeq::Open(FlatFilePos const&, bool)#29908 test: SegFault in `ismine_tests` on SunOS / illumos#30284 Mini miner `AncestorFeerateComparator` Signed Integer Overflow#30402 Illegal Instruction in `CoinStatsIndex::CustomAppend`#31234 fuzz: connman target: terminate called after throwing an instance of 'std::bad_alloc'#32173 validation: `CheckBlockIndex` crashes during block reconsideration#32780 lsan: add more Qt suppressions#32957 SegFault in QSortFilterProxyModelPrivate::build_source_to_proxy_mapping#33150 intermittent TSAN failure in lockmanager_tests::blockmanager_readblock_hash_mismatch#33277 intermittent Segmentation fault in mptest IPC path (callFnAsyncParams)#34014 mptest hangs, when run in a loop#34645 oss-fuzz: coins_view_overlay: ASSERT: m_dirty_count == 0#34655 fuzz: keep `coins_view` fuzzers within caller contracts#34732 i386 segv in #0 0xf7a49ce0 in kj::operator*(kj::_::Stringifier, kj::Exception const&) (/lib/i386-linux-gnu/libkj-1.1.0.so+0x38ce0)#34734 test: Fix shutdown vptr race in BlockFilterIndexSync bench#34777 ipc: AddressSanitizer: heap-use-after-free in `capnp::CallContext<ipc::capnp::messages::BlockTemplate::GetBlockParams, ipc::capnp::messages::BlockTemplate::GetBlockResults>::getParams()`#34782 mptest: mp::CancelMonitor: AddressSanitizer: stack-use-after-return

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 21:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me